1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
The systemd System and Service Manager
Go to file
Zbigniew Jędrzejewski-Szmek 15ee6c204a Revert "pam_systemd: set $DBUS_SESSION_BUS_ADDRESS unconditionally"
This reverts commit 69bd76f2b9.

$DBUS_SESSION_BUS_ADDRESS is again set only if the socket exists.

Quoting https://github.com/systemd/systemd/pull/11327#issuecomment-452019027:
> [setting $DBUS_SESSION_BUS_ADDRESS unconditionally] makes pam_systemd
> incompatible with installations and distributions where dbus was not
> configured with --enable-user-session, and the session dbus-daemon is started
> by autolaunching or dbus-launch (as opposed to dbus.socket). I don't think
> that's wise: using autolaunching or dbus-launch, and disabling or not
> installing dbus.socket and dbus.service on the systemd user instance, is our
> compatibility story for people who still need a D-Bus session bus per X11
> session for whatever reason.
>
> For example, Debian can currently do either way, with a dbus-user-session
> package strongly recommended but not actually mandatory. dbus-user-session
> requires libpam-systemd; if pam_systemd now requires dbus.socket (which is in
> the dbus-user-session package), that's a circular dependency, which we
> normally try hard to avoid.

For systems that use dbus.socket this doesn't matter much, because the
user session is ordered after the user managaer, which pulls in dbus.socket
very early. For example, when logging over ssh:

sshd[20796]: pam_systemd(sshd:session): pam-systemd initializing
sshd[20796]: pam_systemd(sshd:session): Asking logind to create session: uid=1001 pid=20796 service=sshd type=tty class=user desktop= seat= vtnr=0 tty= display= remote=yes remote_user= remote_host=::1
sshd[20796]: pam_systemd(sshd:session): Session limits: memory_max=n/a tasks_max=n/a cpu_weight=n/a io_weight=n/a
systemd[1]: Created slice User Slice of UID 1001.
systemd[1]: Starting User Runtime Directory /run/user/1001...
systemd-logind[1210]: New session 3796 of user guest.
systemd[1]: Started User Runtime Directory /run/user/1001.
systemd[1]: Starting User Manager for UID 1001...
systemd[20805]: pam_systemd(systemd-user:session): pam-systemd initializing
systemd[20805]: Starting D-Bus User Message Bus Socket.
...
systemd[20805]: Reached target Sockets.
systemd[20805]: Reached target Basic System.
systemd[1]: Started User Manager for UID 1001.
systemd[1]: Started Session 3796 of user guest.
sshd[20796]: pam_systemd(sshd:session): Reply from logind: id=3796 object_path=/org/freedesktop/login1/session/_33796 runtime_path=/run/user/1001 session_fd=13 seat= vtnr=0 original_uid=1001
sshd[20796]: pam_unix(sshd:session): session opened for user guest by (uid=0)

Hence, everything in the ssh session is ordered after the user instance.
And in the user instance, services should be orderd after dbus.socket using
inter-unit dependencies. dbus.socket in turns does
systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus.

So there should be no race between starting of the dbus socket and our check
if it exists.

The alternative would be to set the "DBUS_SESSION_BUS_ADDRESS=unix:path=%s/bus;autolaunch:".
AFAICT, this would work as well. But I don't see any case where it actually works
better. Since this is an area with many compatiblity concerns, let's stick to
the previous setup which seems to work well.
2019-01-15 14:24:10 +01:00
.github/ISSUE_TEMPLATE docs: move markdown docs from .github/ to docs/ 2018-09-08 13:39:03 -07:00
.lgtm/cpp-queries lgtm: drop redundant newlines 2018-10-26 14:52:17 +02:00
.mkosi mkosi: update libqrencode in Debian config 2018-12-15 10:55:10 +01:00
catalog catalog: update Polish translation 2018-11-19 09:23:04 +01:00
coccinelle tree-wide: more IOVEC_MAKE() conversions 2018-11-28 13:08:19 +09:00
docs Merge pull request #11317 from filbranden/docs1 2019-01-03 18:38:57 +01:00
factory/etc man,factory: update factory config for nsswitch.conf to match the man pages 2018-11-27 22:35:02 +01:00
hwdb Add Teclast X80 PLUS (H5C5) accel mount matrix 2019-01-08 15:09:08 +01:00
man cat: add --stderr-priority option 2019-01-08 10:37:20 +01:00
modprobe.d Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
network Drop my copyright headers 2018-06-14 13:03:20 +02:00
po po: update Italian translation 2019-01-03 14:44:55 +01:00
presets Drop my copyright headers 2018-06-14 13:03:20 +02:00
rules rules: watch metadata changes on DASD devices 2018-12-04 20:57:47 +01:00
shell-completion zsh completion: Prevent functions from clobbering each other, &c. 2019-01-08 15:23:37 +01:00
src Revert "pam_systemd: set $DBUS_SESSION_BUS_ADDRESS unconditionally" 2019-01-15 14:24:10 +01:00
sysctl.d sysctl.d: switch net.ipv4.conf.all.rp_filter from 1 to 2 2018-11-28 16:29:01 +01:00
sysusers.d sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync 2018-07-16 17:11:50 +02:00
test Merge pull request #11232 from yuwata/fix-9130-alternative 2019-01-08 12:22:21 +09:00
tmpfiles.d sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync 2018-07-16 17:11:50 +02:00
tools Merge pull request #11317 from filbranden/docs1 2019-01-03 18:38:57 +01:00
travis-ci travis: also run TEST-01-BASIC with QEMU to cover udevd and so on 2018-12-29 19:14:35 +01:00
units units: set NoNewPrivileges= for all long-running services 2018-12-18 14:21:35 +01:00
xorg login: avoid external process call 2018-01-12 18:02:57 +01:00
.dir-locals.el coding style: reduce text width to 109 characters 2018-12-08 10:14:28 +01:00
.editorconfig editorconfig: add rule for meson.build files (#6671) 2017-08-28 16:37:23 +02:00
.gitattributes
.gitignore gitignore: add nspawn image lock and mkosi temporary files 2018-09-07 20:00:22 +02:00
.lgtm.yml lgtm: use python3 2018-12-10 03:07:17 +09:00
.mailmap sort .mailmap alphabetically 2018-12-18 12:55:00 +01:00
.travis.yml travis: add another stage to really run everything under ASan+UBsan 2018-12-24 08:52:33 +01:00
.vimrc coding style: reduce text width to 109 characters 2018-12-08 10:14:28 +01:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure build-sys: add basic support for ./configure && make && make install 2017-07-18 10:05:06 -04:00
LICENSE.GPL2
LICENSE.LGPL2.1
Makefile build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
meson_options.txt Merge pull request #11230 from keszybz/version-string-alt 2019-01-03 21:33:55 +09:00
meson.build Merge pull request #11337 from keszybz/build-version-h 2019-01-06 13:55:10 +01:00
mkosi.build mkosi: update the boot loader from our freshly built one 2018-10-16 16:44:34 +02:00
mkosi.default
NEWS NEWS: also mention that clock file for timesyncd may need to move 2019-01-08 10:20:33 +01:00
README Revert "pam_systemd: drop setting DBUS_SESSION_BUS_ADDRESS" 2019-01-04 11:19:10 +01:00
README.md README: embed a CentOS CI badge into README 2018-12-05 12:42:52 +01:00
TODO cgroup: s/cgroups? ?v?([0-9])/cgroup v\1/gI 2019-01-03 11:32:40 +09:00
zanata.xml po: add basic fedora.zanata.org configuration 2018-02-19 13:56:57 +01:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Semaphore CI Build Status
Coverity Scan Status
CII Best Practices
Travis CI Build Status
Language Grade: C/C++
CentOS CI Build Status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.