Systemd/src
Franck Bui 8246905af0 logind: fix (again) the race that might happen when logind restores VT
This patch is a new attempt to fix the race originally described in issue #9754.

The initial fix (commit ad96887a12) consisted in
spawning a sub process that became the controlling process of the VT and hence
kicked the old controlling process off to make sure that the VT wouldn't have
entered in HUP state while logind restored the VT.

But it introduced a regression (see issue #11269) and thus was reverted. But
unlike it was described in the revert commit message, commit
adb8688b3f alone doen't fix the initial race.

This patch fixes the race in a simpler way by trying to restore the VT a second
time after making sure to re-open it if the first attempt fails.

Indeed if the old controlling process dies before or during the first attempt,
logind will fail to restore the VT. At this point the VT is in HUP state but
we're sure that it won't enter in a HUP state a second time. Therefore we will
retry by re-opening the VT to clear the HUP state and by restoring the VT a
second time, which should be safe this time.

Fixes: #9754
Fixes: #13241
2019-11-12 14:53:24 +01:00
..
ac-power
activate tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
analyze tree-wide: drop locale.h when locale-util.h is included 2019-11-04 00:30:32 +09:00
ask-password
backlight util-lib: move shall_restore_state() to shared/reboot-util 2019-09-16 18:08:01 +02:00
basic time-util: uniquify timezone list, in case UTC is listed in timezone1970.tab, too 2019-11-11 17:06:09 +01:00
binfmt tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
boot bootctl: create leading dirs when "bootctl random-seed" is called if needed 2019-11-04 14:26:53 +01:00
busctl tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
cgls tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
cgroups-agent tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
cgtop tree-wide: drop alloca.h when alloc-util.h is included 2019-11-04 00:30:32 +09:00
core Merge pull request #13904 from keur/job_mode_triggering 2019-11-07 08:36:26 +01:00
coredump tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
cryptsetup tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
debug-generator util-lib: move runlevel_to_target() to shared/unit-file 2019-09-16 18:08:00 +02:00
delta tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
detect-virt
dissect
environment-d-generator environment-d-generator: output logs in debug mode 2019-08-30 13:17:37 +02:00
escape
firstboot firstboot: drop duplicate trailing whitespace from root pw question 2019-08-11 06:13:57 +09:00
fsck tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
fstab-generator tree-wide: drop mntent.h when fstab-util.h is included 2019-11-04 00:30:32 +09:00
fuzz tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
getty-generator tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
gpt-auto-generator tree-wide: drop stat.h or statfs.h when stat-util.h is included 2019-11-04 00:30:32 +09:00
hibernate-resume hibernate-resume: add resumeflags= kernel option 2019-06-05 18:59:05 -06:00
hostname tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
hwdb
id128 id128: actually support --pretty 2019-08-20 12:01:23 +02:00
import include missing_fcntl.h where needed 2019-11-07 10:17:44 +00:00
initctl
journal journal-file: delete some unnecessary braces 2019-11-10 12:39:44 +01:00
journal-remote tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
kernel-install kernel-install: do not require non-empty kernel cmdline 2019-08-27 18:30:49 +02:00
libsystemd sd-device-enumerator: do not return error when a device is removed 2019-11-05 22:13:11 +01:00
libsystemd-network sd-radv: fix memleak 2019-11-05 13:30:00 +09:00
libudev tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
locale tree-wide: drop locale.h when locale-util.h is included 2019-11-04 00:30:32 +09:00
login logind: fix (again) the race that might happen when logind restores VT 2019-11-12 14:53:24 +01:00
machine tree-wide: drop locale.h when locale-util.h is included 2019-11-04 00:30:32 +09:00
machine-id-setup machine-id-setup: avoid unexpected aborting 2019-10-25 13:35:37 +09:00
modules-load tree-wide: drop libkmod.h when module-util.h is included 2019-11-04 00:30:32 +09:00
mount basic/fs-util: change CHASE_OPEN flag into a separate output parameter 2019-10-24 22:44:24 +09:00
network network: split struct Prefix into Prefix and RoutePrefix 2019-11-05 22:31:20 +09:00
notify tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
nspawn Add @pkey syscall group 2019-11-08 14:41:22 +01:00
nss-myhostname tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
nss-mymachines meson: make nologin path build time configurable 2019-07-18 12:46:35 +02:00
nss-resolve tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
nss-systemd meson: make nologin path build time configurable 2019-07-18 12:46:35 +02:00
partition tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
path
portable basic/fs-util: change CHASE_OPEN flag into a separate output parameter 2019-10-24 22:44:24 +09:00
pstore tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
quotacheck
random-seed tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
rc-local-generator
remount-fs tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
reply-password tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
resolve tree-wide: drop gcrypt.h when gcrypt-util.h is included 2019-11-04 00:30:32 +09:00
rfkill util-lib: move shall_restore_state() to shared/reboot-util 2019-09-16 18:08:01 +02:00
run various tools: be more explicit when a glob is passed when not supported 2019-10-25 13:41:49 +09:00
run-generator
shared Merge pull request #13975 from keszybz/more-seccomp-syscalls 2019-11-09 23:27:34 +09:00
shutdown tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
sleep tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
socket-proxy tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
stdio-bridge
sulogin-shell
sysctl tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
system-update-generator util-lib: move runlevel_to_target() to shared/unit-file 2019-09-16 18:08:00 +02:00
systemctl Merge pull request #13554 from keur/systemctl_status_timer 2019-11-08 14:19:40 +01:00
systemd networkd: dhcp server Support Vendor specific 43 2019-10-31 09:03:43 +09:00
sysusers Revert "sysusers: properly mark generated accounts as locked" 2019-10-22 17:59:11 +09:00
sysv-generator tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
test core: change top-level drop-in from -.service.d to service.d 2019-11-07 08:34:53 +01:00
time-wait-sync tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
timedate tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
timesync tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
tmpfiles Merge pull request #13862 from zachsmith/systemd-tmpfiles-deprecate-for-force 2019-11-12 10:28:59 +01:00
tty-ask-password-agent tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
udev udev: do not append newline when write attributes 2019-11-12 09:25:00 +01:00
update-done
update-utmp tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
user-sessions
vconsole tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
veritysetup tree-wide: replace strjoin() with path_join() 2019-06-24 23:59:38 +09:00
version
volatile-root basic/fs-util: change CHASE_OPEN flag into a separate output parameter 2019-10-24 22:44:24 +09:00