Commit graph

42 commits

Author SHA1 Message Date
Ray Strode
a5c1ccd711 autogoo: Drop the goo
We have meson support now, get rid of the cruft.
2022-11-14 13:40:56 -05:00
Niels De Graef
95d3e3bbf9 Port build system to Meson 2022-11-14 12:21:55 -05:00
Maxim Mikityanskiy
2f12aa4c5d systemd: Add mkinitcpio support to plymouth-switch-root-initramfs.service
plymouth-switch-root-initramfs.service commands plymouth to release
rootfs to allow the shutdown ramfs to unmount rootfs. However, it only
integrates with dracut. Arch Linux uses mkinitcpio by default, and it
uses shutdown ramfs when layered block storage (e.g. LUKS) is used for
rootfs. Therefore, it fails to unmount rootfs on shutdown if LUKS and
plymouth are used together.

Add a new trigger for plymouth-switch-root-initramfs.service to start
when /run/initramfs/shutdown exists (/run/initramfs/bin/sh may not exist
with mkinitcpio when systemd-based initramfs is used), and add a
dependency to start it after mkinitcpio generates the shutdown ramfs.
2022-10-15 14:44:03 +00:00
Ray Strode
2a7755febb systemd: Add plymouth-switch-root-initramfs.service to switch back to initramfs on shutdown
Add a plymouth-switch-root-initramfs.service, which will call
"plymouth update-root-fs --new-root-dir=/run/initramfs" to switch back
to the initramfs (when applicable).

Systemd will run this service before plymouthd receives the SIGTERM on
shutdown, so this will cause the plymouthd-fd-escrow helper to run
from the initramfs.

This avoids the plymouthd-fd-escrow helper keeping the rootfs busy.

Changes by Hans de Goede:
- Fix a couple of typos
- Add Conflicts=dracut-shutdown.service to plymouth-switch-root-initramfs.service
  dracut-shutdown.service restores the initramfs when it is _stopped_
  use Conflicts to make sure its ExecStop has run before we do
- Add a check for switching back to the initramfs to on_newroot () and dump
  the debug-buffer before the switch (while we still have access to /var/log).
- Also add plymouth-switch-root-initramfs.service to kexec.target.wants.
  kexec.target.wants uses --mode=shutdown, so the plymouthd-fd-escrow helper
  will run, so we need to switch to the initramfs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-04-06 13:45:41 +02:00
Ray Strode
9d0f8b2e7b systemd: switch to KillMode=mixed
KillMode=none is deprecated, so we need to stop using it.

For now, use `KillMode=mixed` and `IgnoreOnIsolate=true` instead.

In the future, we should change plymouth to be able to exit and
start again without restarting the active animation, but that's
going to require some effort.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/123
2021-02-22 12:45:11 +00:00
Hans de Goede
75fc290c24 Add RemainAfterExit=yes to plymouth's systemd service files
All plymouth's systemd unit files are meant to only run once, either during
boot or during shutdown/restart.

Certain events cause systemd to recheck the dependency try between systemd
units. Systemd had a bug before the 245 release which caused this check to
sometimes not restart exited services for which the dependencies are met.

Systemd 245 fixes this, this is causing problems with plymouth.
When the conditions are met for systemd to recheck the dependencies;
and the plymouthd started by plymouth-start.service has exited;
then systemd will restart the plymouth-start unit, causing plymouthd to
take over tty1 after boot. This is causing various problems, also see:

https://bugzilla.redhat.com/show_bug.cgi?id=1803293

Since all plymouth's systemd units are intended to run only once, they
all should be marked as remaining after exit by adding:
"RemainAfterExit=yes" to them. This causes systemd to still consider them
running after e.g. plymouthd has exited, as long as they have started
successfully. This fixes systemd restarting plymouth's units when it
should not do so.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1803293
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1807771
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-03-23 17:22:46 +01:00
Hans de Goede
e0af56113a systemd-ask-password-plymouth.service.in: Do not hardcode /run path to pid file
Use @plymouthruntimedir@/pid in systemd-ask-password-plymouth.service.in so
that the way the path to the pidfile is build there is identical to the
way the --pidfile argument is build in plymouth-start.service.in.

Fixes #26

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-13 16:56:01 +02:00
ZhaoQiang
66a214c615 Revert "Merge branch 'avoid_shutdown_failure_v2' into 'master'"
This reverts merge request !55
2019-09-06 10:17:07 +00:00
ZhaoQiang
a473e1c47d ply-systemd-units: Drop attach-session in systemd-units to avoid
the failure of unmounting separate /var during poweroff.
2019-08-13 17:44:36 +08:00
Hans de Goede
a42915c972 Add new reboot and system-upgrade modes
Some themes show certain text strings to the user depending on the mode,
see e.g. the shutdown vs reboot mockups of:
https://wiki.gnome.org/Design/OS/BootProgress

Besides during shutdown vs reboot, we also want different theming for
installing offline (security) updates versus doing an offline OS upgrade.

To make this possible this commit adds new reboot and system-upgrade
modes which can be specified either when starting plymouthd, or through
plymouth change-mode --<mode>.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-02-26 17:01:03 +01:00
Laurent Bigonville
763c023caa systemd-units: Also add "ConditionVirtualization=!container" in systemd-ask-password-plymouth.path.in
This completes the fix for #27
2018-11-08 11:05:05 +00:00
Hans de Goede
9ed2a0c55b systemd-units: Add "ConditionVirtualization=!container"
When running in a container with plymouth installed, plymouth is started
unnecessarily and systemd prints warnings:

[  OK  ] Reached target Shutdown.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Process 253 (plymouthd) has been been marked to be excluded from killing. It is running from the root file system, and thus likely to block re-mounting of the root file system to read-only. Please consider moving it into an initrd file system instead.

It makes little sense to start plymouth in contains, so add
'ConditionVirtualization=!container' everywhere where
ConditionKernelCommandLine=!plymouth.enable=0 appears to disable plymouth
in containers.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1337611
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/issues/27
2018-08-07 09:58:58 -04:00
Ray Strode
8edd4c36f8 Revert "wip! systemd-units: add unit to switch back to initrd at shutdown"
This reverts commit 82b2b09639.
2018-05-31 10:52:34 -04:00
Ray Strode
82b2b09639 wip! systemd-units: add unit to switch back to initrd at shutdown
plymouthd currently sticks around on the main filesystem during
shutdown, while shutdown proceeds on the initramfs.

This commit adds a unit to make it jump into the initramfs too.

This is important, so we can run the drm escrow binary from
the initramfs.
2018-04-26 10:41:22 -04:00
Ray Strode
8efc272a7a systemd-units: Fix uninstall script
This commit fixes some typos in the uninstall: target
2016-06-20 15:53:48 -04:00
Laurent Bigonville
2c65fc7c22 Revert "systemd: add WantedBy snippets"
This reverts commit 7adb50c267.

The .service files are already statically enabled, adding the Install
section and the WantedBy option is useless

Conflicts:
	systemd-units/plymouth-quit-wait.service.in

https://bugs.freedesktop.org/show_bug.cgi?id=80048
2014-07-28 14:56:29 -04:00
Ray Strode
7091fe54a6 systemd: give plymouth-quit-wait a better description
plymouth-quit-wait.service is a synchronization point that
other services tie into, so they know when boot is finished
and the splash is down.

Unfortunately, in cases where the boot stalls, the last thing
users see is:

Starting Wait for Plymouth Boot Screen to Quit...

and then assume the problem is with the boot splash.

This commit makes the description less finger-pointy.
2014-06-13 11:03:26 -04:00
Ray Strode
aaad73c396 systemd-units: ensure udevd is started before plymouthd
We need to make sure udevd is started before plymouthd since we
need to know that "queue is empty" means "coldplug complete" not
"coldplug hasn't started yet".
2013-12-11 13:00:02 -05:00
Ray Strode
90a23b832d systemd: don't call udevadm settle before show-splash
Since we're monitoring udev explicitly now, we have no
need to block the client show-splash request until graphics
devices settle.

This commit removes the udevadm calls from plymouth-start.service.
2013-12-10 01:01:34 -05:00
Ray Strode
37d2e400d2 systemd-units: don't timeout the plymouth waiting
A timeout causes things to fail, so we shouldn't timeout.
2013-11-15 12:41:59 -05:00
Frederic Crozat
53f6b44e11 systemd units: halt/reboot/kexec/power systemd unit have changed names
Ensure we use the new 'systemd-' prefixed names now.
2013-07-29 17:41:30 +02:00
Colin Walters
de4f23a868 systemd units: Replace prefdm.service with display-manager.service
The former is dead, the latter is the new name.  See:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=b2c9cbafb8b1a2742978e1faf37fbb3cf4fb5d44
https://fedoraproject.org/wiki/Features/DisplayManagerRework
2013-07-19 10:25:20 -04:00
Frederic Crozat
cf99635f16 systemd: make sure to ignore all exit codes in ExecStartPost 2013-06-10 13:19:48 -04:00
Cristian Rodríguez
e83a754b91 Lookup the location of udevadm
It is not always in /bin , but /usr/...
2013-04-16 08:48:05 -04:00
Cristian Rodríguez
8f373680dd systemd: Look up systemd-tty-ask-password-agent location
Don't assume it's in /bin.
2013-04-14 12:06:38 -04:00
Ray Strode
5f3ebd4f6d systemd: add Wants: systemd-vconsole-setup.service
Harald says we need it.
2013-03-26 11:41:55 -04:00
Ray Strode
8be792a5a7 systemd: add plymouth-start.service to initrd-switch-root.target
<haraldh> halfline, can you add plymouth-start.service to
plymouth-populate-initrd ??
<halfline> haraldh: sure, can you give me details on the bug its fixing?
<haraldh> except, if you put yourself out of the plymouth cgroup
<haraldh> and the "@" in argv[0][0]
<haraldh> better put plymouth-start.service in the
initrd-switch-root.target
<haraldh> easier
<halfline> well we already do the "@" in argv[0][0]
<halfline> and we already put KillMode=none SendSIGKILL=no in the
service file
<halfline> but will add the change
<haraldh> hmm, ok
2013-03-13 10:24:14 -04:00
Christoph Brill
7adb50c267 systemd: add WantedBy snippets
This fixes systemctl enable.

https://bugs.freedesktop.org/show_bug.cgi?id=38348
2012-11-07 14:33:59 -05:00
Cosimo Cecchi
714a08b0c0 service: start plymouthd unconditionally
It's possible to get in a state where plymouthd is
started in the initrd but not displayed.  In the
event this happens, we'll neglect to ever show it,
since it already has a pid file.

plymouthd is now hardened against getting called
multiple times, so we no longer need to protect it
at the systemd level.

This commit drops the

ConditionPathExists=!@plymouthruntimedir@/pid

line from the systemd service file, so we always
call plymouthd from the main fs and always call
plymouth show-splash.
2012-09-10 17:01:51 -04:00
Ray Strode
3ee341d941 systemd: start after udev triggers
This fixes the race where udevadm settle finishes too early.
2012-08-20 14:35:34 -04:00
Ray Strode
c8e548d5e4 systemd: don't run read-write service from initrd
the initrd hits the local-fs.target as part of its normal
boot process.  We used to use local-fs.target as a way of
knowing the system / is read-write.  This no longer is a
valid mechanism.

This commit:

1) Stops installing plymouth-read-write service in the initrd
2) Makes it so if it does end up in the initrd it won't be
used

Related to fedora bug 830482
2012-07-26 13:05:22 -04:00
Ray Strode
63737f30c8 systemd: add plymouth-switch-root.service
This service file is needed by systemdized dracut to ensure we properly
transition from the initrd to the root file system
2012-07-23 17:37:03 -04:00
Ray Strode
88c2e7dcf8 systemd: more updates to start service
The dashes next to the semi-colons seem to confuse systemd so drop them.
2012-07-23 17:37:03 -04:00
Frederic Crozat
edde4e0f2b systemd: create missing links various targets 2012-07-21 03:22:37 -04:00
Ray Strode
906477ce30 systemd: make sure plymouth-start never gets killed
systemd tries to bring down the world when going from
the initramfs to /

commit 9e5a276f32 tried
to prevent plymouthd from getting killed by settings
argv[0][0] to @

This isn't seemingly sufficient.  Throw some lines into
the plymouth-start service file that should hopefully help.
2012-07-17 17:12:03 -04:00
Ray Strode
d7aa800c39 systemd: unfoul up Makefile
The previous systemd commit introduced a file named

systemd-ask-password-plymouth.path.in

The makefile was only looking for .service.in files
when stripping the .in suffix, so it got installed
incorrectly.

This commit fixes up the Makefile.
2012-07-10 10:17:50 -04:00
Ray Strode
76d0db51c2 systemd: add two more files
When plymouth service files were moved from systemd to plymouth
two files got lost in the shuffle.

This commit adds them.

http://bugzilla.freedesktop.org/51573
2012-07-09 11:59:59 -04:00
Ray Strode
675553481d systemd: more udev clean ups
The udev trigger calls that are there, are actually
spurious.  udev will coldplug those subsystems at
start up anyway, so doing it explicitly is wrong.

This commit drops those trigger calls.

What does matter is the udevadm settle call. It's
what makes things block until the graphics driver
is loaded.

udevadm settle is a big sledgehammer, though. It blocks
until all the triggered events (even stuff unrelated to
graphics) are finished.

This commit adds a --exit-if-exists argument to udevadm settle,
so it will bail early as soon as the graphics devices
are up.
2012-06-20 11:57:06 -04:00
Ray Strode
b8031858cd systemd: drop weird udev trigger --attr-match=class=0x030000
plymouth-start.service does this sort of hacky
"udevadm trigger" stuff before doing plymouth show-splash,
to ensure plymouth show-splash is called after the
graphcis subsystem is up.

It actually does two calls:

- one call that triggers any pci devices with the class
0x030000 (which is "vga compatible display device")
- another call that triggers the gpu subsystem

The first call is borrowed from dracut:

http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commitdiff;h=2c02c8318

and I can't find any historical context on why its needed.  As I
understand things, the latter should be a superset of the former.
Furthermore, the first trigger is missing a --subsystem-match=pci call
so it's matching the "class" attribute in every subsystem, which is slow.

I'm going to drop the first trigger until I start hitting problems
and need to add it back.
2012-06-20 11:19:05 -04:00
Ray Strode
0fd2406991 Revert "systemd: add --subsystem=pci to udevadm trigger call"
This reverts commit cf90d3c7fa.

It was wrong. I misunderstood what Kay told me.
2012-06-20 11:01:07 -04:00
Ray Strode
cf90d3c7fa systemd: add --subsystem=pci to udevadm trigger call
plymouth-start.service does this sort of hacky
"udevadm trigger" call before doing plymouth show-splash,
to ensure plymouth show-splash is called after the
graphcis subsystem is up.  Because this udev trigger call
only passes --subsystem-match calls with no corresponding
--subsystem call, it will trawl through all subsystems in
/sys rather than just the pci subsystem (where all the matches
are guaranteed to be).

This commit adds --subsystem=pci to stop doing that extra work.

All of this will eventually be replaced with plymouthd either
listening for the udev  events itself (or potentially logind,
if logind gains a way to tag a "graphics" capability on a seat).
2012-06-20 10:48:26 -04:00
Ray Strode
29f832fc74 systemd: pull units from systemd tree
Kay and Lenny want the service files shipped with plymouth
instead of systemd, so toss them into the tree.
2012-06-06 10:12:59 -04:00