Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > e8131fcbaf2e02a3877b93b281a899fb > files > 12

systemd-230-12.1.mga6.src.rpm

From 7ee1262e48fa87768f9bf3596469d394a832f233 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Thu, 8 Mar 2012 21:56:11 +0000
Subject: [PATCH 502/512] mageia: Fallback message when display manager fails.

Provide a unit for displaying a message to the user when the
display manager fails. This can be when no dm application is
installed or when it exits with a failure code.

Much like the prefdm script, the actual message is included
in the initscripts package.

https://bugs.mageia.org/show_bug.cgi?id=4769

v2: Use agetty rather than mingetty + quit plymouth + don't wait for
    graphical.target
v3: Use Type=idle now available upstream
v4: Add back the prefdm.service script removed in v188
v5: Remove Conflicts on plymouth-quit.service, as plymouth quits
    reliably and gracefully now through systemd.
---
 Makefile.am                                  |  5 +++++
 units/mageia/display-manager-failure.service | 30 ++++++++++++++++++++++++++++
 units/mageia/prefdm.service                  | 15 ++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 units/mageia/display-manager-failure.service
 create mode 100644 units/mageia/prefdm.service

diff --git a/Makefile.am b/Makefile.am
index 305099a..7ce89e6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -635,6 +635,11 @@ units-uninstall-hook:
 INSTALL_DATA_HOOKS += units-install-hook
 UNINSTALL_DATA_HOOKS += units-uninstall-hook
 
+# Just for Mageia for now until we switch to new methods of starting the appropriate DM
+dist_systemunit_DATA += \
+	units/mageia/prefdm.service \
+	units/mageia/display-manager-failure.service
+
 dist_doc_DATA = \
 	README \
 	NEWS \
diff --git a/units/mageia/display-manager-failure.service b/units/mageia/display-manager-failure.service
new file mode 100644
index 0000000..3a79ba5
--- /dev/null
+++ b/units/mageia/display-manager-failure.service
@@ -0,0 +1,30 @@
+[Unit]
+Description=Display Manager Failure Message
+After=dev-tty1.device systemd-user-sessions.service shutdown.target
+
+Conflicts=getty@tty1.service
+After=getty@tty1.service
+
+[Service]
+Environment=TERM=linux
+ExecStartPre=-/bin/plymouth quit
+ExecStart=-/sbin/agetty --noissue --nohostname -n --autologin nobody --login-program /usr/bin/display-manager-failure-message tty1
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=tty1
+TTYPath=/dev/tty1
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+KillMode=process
+IgnoreSIGPIPE=no
+
+# Unset locale for the console getty since the console has problems
+# displaying some internationalized messages.
+Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
+
+# Some login implementations ignore SIGTERM, so we send SIGHUP
+# instead, to ensure that login terminates cleanly.
+KillSignal=SIGHUP
+
diff --git a/units/mageia/prefdm.service b/units/mageia/prefdm.service
new file mode 100644
index 0000000..fdc3d51
--- /dev/null
+++ b/units/mageia/prefdm.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Display Manager
+After=livesys-late.service systemd-user-sessions.service
+
+# On Mageia gdm/X11 is on tty1. We explicitly cancel the getty here to
+# avoid any races around that.
+Conflicts=getty@tty1.service
+After=getty@tty1.service plymouth-quit.service
+OnFailure=display-manager-failure.service
+
+[Service]
+ExecStart=/etc/X11/prefdm -nodaemon
+Restart=always
+RestartSec=0
+IgnoreSIGPIPE=no
-- 
2.9.2