-I$(srcdir)/libply-splash-core \
-I$(srcdir) \
-DPLYMOUTH_LOCALE_DIRECTORY=\"$(localedir)\" \
+ -DPLYMOUTH_DRM_ESCROW_DIRECTORY=\"$(libexecdir)/plymouth\" \
-DPLYMOUTH_LOG_DIRECTORY=\"$(localstatedir)/log\" \
-DPLYMOUTH_SPOOL_DIRECTORY=\"$(localstatedir)/spool/plymouth\" \
-DPLYMOUTH_TIME_DIRECTORY=\"$(localstatedir)/lib/plymouth/\" \
plugins/splash/details/plugin.c \
main.c
+escrowdir = $(libexecdir)/plymouth
+escrow_PROGRAMS = plymouthd-fd-escrow
+
+plymouthd_fd_escrow_SOURCES = plymouthd-fd-escrow.c
+
plymouthdrundir = $(localstatedir)/run/plymouth
plymouthdspooldir = $(localstatedir)/spool/plymouth
plymouthdtimedir = $(localstatedir)/lib/plymouth
raise (signum);
}
+static void
+start_plymouthd_fd_escrow (void)
+{
+ pid_t pid;
+
+ pid = fork ();
+ if (pid == 0) {
+ const char *argv[] = { PLYMOUTH_DRM_ESCROW_DIRECTORY "/plymouthd-fd-escrow", NULL };
+
+ execve (argv[0], (char * const *) argv, NULL);
+ ply_trace ("could not launch fd escrow process: %m");
+ _exit (1);
+ }
+}
+
static void
on_term_signal (state_t *state)
{
ply_trace ("received SIGTERM");
+ /*
+ * On shutdown/reboot with pixel-displays active, start the plymouthd-fd-escrow
+ * helper to hold on to the pixel-displays fds until the end.
+ */
+ if ((state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN ||
+ state->mode == PLY_BOOT_SPLASH_MODE_REBOOT) &&
+ !state->is_inactive && state->boot_splash &&
+ ply_boot_splash_uses_pixel_displays (state->boot_splash)) {
+ start_plymouthd_fd_escrow ();
+ retain_splash = true;
+ }
+
on_quit (state, retain_splash, ply_trigger_new (NULL));
}
--- /dev/null
+#include <signal.h>
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+ signal (SIGTERM, SIG_IGN);
+
+ /* Make the first byte in argv be '@' so that we can survive systemd's killing
+ * spree until the power is killed at shutdown.
+ * http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
+ */
+ argv[0][0] = '@';
+
+ while (pause());
+
+ return 0;
+}