logind: provide a way to restore fd's on restart #1163

Closed
mbiebl opened this Issue Sep 5, 2015 · 0 comments

Comments

Projects
None yet
2 participants
Contributor

mbiebl commented Sep 5, 2015

Background is this commit
http://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e1013e2d69e3f59ae3cbc0c893473

If the xserver is built with logind support, restarting logind will cause your X session to be terminated.

The commit mentions, that logind misses the facility to restore fds during a restart.
For journald this seems to have been fixed in v219, a similar fix should be added to logind, so this Xorg patch can be reverted.

@mbiebl mbiebl added the login label Sep 5, 2015

@poettering poettering added the RFE label Sep 5, 2015

manover pushed a commit to manover/systemd that referenced this issue Jul 8, 2016

debian/tests/logind: ensure correct version of logind is running
systemd-logind can't be restarted during upgrades, see git commit b8c239e and
systemd/systemd#1163

But if we don't upgrade logind during our tests we might end up with calling
unsupported methods, e.g. failing as follows during an autopkgtest test run
within a jessie environment with the systemd backport:

| Error: org.freedesktop.DBus.Error.UnknownMethod
| Unknown method 'ScheduledShutdown' or interface 'org.freedesktop.login1.Manager'.

xaiki added a commit to endlessm/systemd that referenced this issue Feb 1, 2017

debian/tests/logind: ensure correct version of logind is running
systemd-logind can't be restarted during upgrades, see git commit b8c239e12 and
systemd/systemd#1163

But if we don't upgrade logind during our tests we might end up with calling
unsupported methods, e.g. failing as follows during an autopkgtest test run
within a jessie environment with the systemd backport:

| Error: org.freedesktop.DBus.Error.UnknownMethod
| Unknown method 'ScheduledShutdown' or interface 'org.freedesktop.login1.Manager'.

fbuihuu added a commit to fbuihuu/systemd that referenced this issue Mar 16, 2017

logind: save session devices so they can be restored when logind is r…
…estarted

With this patch, restarting logind should be fully supported.

Fixes: #1163

fbuihuu added a commit to fbuihuu/systemd that referenced this issue Mar 23, 2017

logind: save session devices so they can be restored when logind is r…
…estarted

With this patch, restarting logind should be fully supported.

Fixes: #1163

fbuihuu added a commit to fbuihuu/systemd that referenced this issue Apr 28, 2017

logind: save/restore session devices and their respective file descri…
…ptors

This patch ensures that session devices are saved for each session.

In order to make the revokation logic work when logind is restarted, the
session devices are now saved in the session state files and their respective
file descriptors sent to PID1's fdstore in order to keep them open accross
restart.

This is mandatory in order to keep the revokation logic working. Indeed in case
of input-devices, the same file descriptors must be shared by logind and a
given session controller in order EVIOCREVOKE to work otherwise multiple
sessions can have device access in parallel.

This should be the only remaining and missing piece for making logind fully
restartable.

Fixes: #1163

fbuihuu added a commit to fbuihuu/systemd that referenced this issue May 4, 2017

logind: save/restore session devices and their respective file descri…
…ptors

This patch ensures that session devices are saved for each session.

In order to make the revokation logic work when logind is restarted, the
session devices are now saved in the session state files and their respective
file descriptors sent to PID1's fdstore in order to keep them open accross
restart.

This is mandatory in order to keep the revokation logic working. Indeed in case
of input-devices, the same file descriptors must be shared by logind and a
given session controller in order EVIOCREVOKE to work otherwise multiple
sessions can have device access in parallel.

This should be the only remaining and missing piece for making logind fully
restartable.

Fixes: #1163

fbuihuu added a commit to fbuihuu/systemd that referenced this issue May 4, 2017

logind: save/restore session devices and their respective file descri…
…ptors

This patch ensures that session devices are saved for each session.

In order to make the revokation logic work when logind is restarted, the
session devices are now saved in the session state files and their respective
file descriptors sent to PID1's fdstore in order to keep them open accross
restart.

This is mandatory in order to keep the revokation logic working. Indeed in case
of input-devices, the same file descriptors must be shared by logind and a
given session controller in order EVIOCREVOKE to work otherwise multiple
sessions can have device access in parallel.

This should be the only remaining and missing piece for making logind fully
restartable.

Fixes: #1163

fbuihuu added a commit to fbuihuu/systemd that referenced this issue May 12, 2017

logind: save/restore session devices and their respective file descri…
…ptors

This patch ensures that session devices are saved for each session.

In order to make the revokation logic work when logind is restarted, the
session devices are now saved in the session state files and their respective
file descriptors sent to PID1's fdstore in order to keep them open accross
restart.

This is mandatory in order to keep the revokation logic working. Indeed in case
of input-devices, the same file descriptors must be shared by logind and a
given session controller in order EVIOCREVOKE to work otherwise multiple
sessions can have device access in parallel.

This should be the only remaining and missing piece for making logind fully
restartable.

Fixes: #1163

glennpratt pushed a commit to acquia/systemd that referenced this issue Jun 5, 2017

Import patches-unapplied version 226-4 to debian/sid
Imported using usd-importer.

Publish parent: 8701d07

New changelog entries:
  * debian/tests/logind: Be more verbose on failures.
  * Revert networkd calling if-{up,post-down}.d/ scripts. About half of the
    existing hooks are not relevant or even actively detrimental when running
    with networkd. For the relevant ones, a lot of them should be fixed in the
    projects themselves (using IP_FREEBIND etc.). (Closes: #798625)
  * Add systemd-networkd-resolvconf-update.{path,service} units to send DNS
    server updates from networkd to resolvconf, if installed and enabled.
  * Don't restart logind on upgrades any more. This kills X.org (#798097)
    while logind doesn't save/restore its open fds (issue #1163), and also
    gets confused about being idle in between (LP: #1473800)

glennpratt pushed a commit to acquia/systemd that referenced this issue Jun 5, 2017

Import patches-unapplied version 225-1ubuntu7 to ubuntu/wily-proposed
Imported using usd-importer.

Publish parent: 4ee75fc

New changelog entries:
  * Don't restart logind on upgrades any more. This kills X.org (#798097)
    while logind doesn't save/restore its open fds (issue #1163), and also
    gets confused about being idle in between (LP: #1473800)
  * debian/extra/initramfs-tools/hooks/udev: Copy all
    /etc/udev/rules.d/*.rules rules which are not merely overriding the one in
    /lib/, not just 70-persistent-net.rules.  They might contain network names
    or other bits which are relevant for the initramfs. (Closes: #795494)
  * ifup@.service: Drop PartOf=network.target; we don't want to stop these
    units during shutdown. Stopping networking.service already shuts down the
    interfaces, but contains the safeguard for NFS or other network file
    systems. Isolating emergency.target still keeps working as before as well,
    as this also stops networking.service. (Closes: #761909, LP: #1492546)
  * networkd: Change IPForward= default to "kernel". This keeps compatibility
    with lots of packages which expect to be able to enable global forwarding
    in /proc/sys/net/ipv4/ip_forward. (LP: #1500992)

@keszybz keszybz closed this in aed24c4 Jun 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment