diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-03-29 11:05:01 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-03-31 16:35:27 +0200 |
commit | 156ae7437efaf32825d92943577f24914cf56cec (patch) | |
tree | 429d9fba506295cf2c8ca8eb63f4e637fddc9222 | |
parent | 630ca2e18fc63c3e144f11b54faf70228d4d2e92 (diff) |
main: Only mark plymouthd as unkillable when running from the initrd
Before this commit plymouthd would always mark itself as "unkillable"
by setting "argv[0][0] = '@';" as documented here:
https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
There are 2 problems with this:
1. This causes filesystems to fail to remount read-only in some case,
plymouthd may be holding open a deleted file (say an upgraded library).
If that happens, then the filesystem won't allow the disk to be remounted
read-only, because when plymouth dies, the filesystem will need to do I/O
to clean up the removed file from disk.
2. This causes the "gracefully shutdown" of displays which the kernel's
i915 driver recently introduced in commit fe0f1e3bfdfe ("drm/i915: Shut
down displays gracefully on reboot") to get undone. Because of being
"unkillable" plymouthd keeps running and showing the spinner animation
to the very end, this results in a drmModeSetCrtc () call after the i915
display driver has turned off the displays. This causes 2 issues:
2.1 This causes the screen to go black for 1-2 seconds and then show the
plymouth screen again for 1-2 seconds on poweroff/reboot which looks ugly:
https://bugzilla.redhat.com/show_bug.cgi?id=1941329
2.2 This may cause issues with the attached monitors on reboot, since it
undoes the gracefull shutdown which the i915 does.
Change the code to only set "argv[0][0] = '@';" when run from the initrd
at bootup, this solves the 2 mentioned issues and brings the code inline
with the above specification which says this should only ever be used for
daemons started from the initrd.
Note this will cause plymouth to get killed on shutdown, leading to the
last couple of text messages of shutdown being shown on shutdown.
This will be fixed by the next couple of patches.
Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/118
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1941329
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2214,11 +2214,14 @@ main (int argc, } /* Make the first byte in argv be '@' so that we can survive systemd's killing - * spree when going from initrd to /, and so we stay alive all the way until - * the power is killed at shutdown. + * spree when going from initrd to / * http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons + * Note ply_file_exists () does not work here because /etc/initrd-release + * is a symlink when using a dracut generated initrd. */ - argv[0][0] = '@'; + if (state.mode == PLY_BOOT_SPLASH_MODE_BOOT_UP && + access ("/etc/initrd-release", F_OK) >= 0) + argv[0][0] = '@'; state.boot_server = start_boot_server (&state); |