Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > 3dd8bca5a331f46a5ba1cbec6d91c01d > files > 22

systemd-217-11.2.mga5.src.rpm

From 3415e4239d38b15f4d07f5ef1981502c90eea4e5 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/511] 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
---
 Makefile.am                                  |  5 +++++
 units/mageia/display-manager-failure.service | 30 ++++++++++++++++++++++++++++
 units/mageia/prefdm.service                  | 16 +++++++++++++++
 3 files changed, 51 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 e238cde..4f55132 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -590,6 +590,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..a2545e4
--- /dev/null
+++ b/units/mageia/prefdm.service
@@ -0,0 +1,16 @@
+[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.
+# Do not stop plymouth, it is done in prefdm if required (or left to the dm)
+Conflicts=getty@tty1.service plymouth-quit.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
-- 
1.9.2