Control: affects 748668 xdm

Here is the patch for installing the systemd service from xdm and following the default display manager selection.

Didier
diff -u xdm-1.1.11/debian/xdm.postinst.in xdm-1.1.11/debian/xdm.postinst.in
--- xdm-1.1.11/debian/xdm.postinst.in
+++ xdm-1.1.11/debian/xdm.postinst.in
@@ -71,6 +71,24 @@
   update-rc.d xdm defaults 99 01
 fi
 
+DEFAULT_SERVICE=/etc/systemd/system/display-manager.service
+# set default-display-manager systemd service link according to our config
+if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then
+  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
+    SERVICE=/lib/systemd/system/$(basename $(cat 
"$DEFAULT_DISPLAY_MANAGER_FILE")).service
+    if [ -h "$DEFAULT_SERVICE" ] && [ $(readlink "$DEFAULT_SERVICE") = 
/dev/null ]; then
+      echo "Display manager service is masked" >&2
+    elif [ -e "$SERVICE" ]; then
+      ln -sf "$SERVICE" "$DEFAULT_SERVICE"
+    else
+      echo "WARNING: $SERVICE is the selected default display manager but does 
not exist" >&2
+      rm -f "$DEFAULT_SERVICE"
+    fi
+  else
+    rm -f "$DEFAULT_SERVICE"
+  fi
+fi
+
 # Whether we are installing or upgrading, we check the options file to see if
 # the user wants the daemon (re-)started.
 NOSTART=
diff -u xdm-1.1.11/debian/xdm.install xdm-1.1.11/debian/xdm.install
--- xdm-1.1.11/debian/xdm.install
+++ xdm-1.1.11/debian/xdm.install
@@ -10,6 +10,7 @@
 etc/X11/xdm/xdm-config
 etc/X11/xdm/xdm.options
 etc/insserv.conf.d/xdm
+lib/systemd/system/xdm.service
 usr/bin/xdm
 usr/lib/X11/xdm/chooser
 usr/lib/X11/xdm/libXdmGreet.so
diff -u xdm-1.1.11/debian/changelog xdm-1.1.11/debian/changelog
--- xdm-1.1.11/debian/changelog
+++ xdm-1.1.11/debian/changelog
@@ -1,3 +1,13 @@
+xdm (1:1.1.11-2) UNRELEASED; urgency=medium
+
+  * debian/patches/dont_override_defaultdm_on_systemd.diff,
+    debian/xdm.posinst, debian/xdm.install:
+    - install the xdm service
+    - ensure we are starting xdm under systemd only when selected as
+      default. (Closes: #748668)
+
+ -- Didier Roche <didro...@ubuntu.com>  Tue, 25 Nov 2014 16:38:28 +0100
+
 xdm (1:1.1.11-1) unstable; urgency=low
 
   [ Joe Hansen ]
diff -u xdm-1.1.11/debian/patches/series xdm-1.1.11/debian/patches/series
--- xdm-1.1.11/debian/patches/series
+++ xdm-1.1.11/debian/patches/series
@@ -14,0 +15 @@
+dont_override_defaultdm_on_systemd.diff
only in patch2:
unchanged:
--- xdm-1.1.11.orig/debian/patches/dont_override_defaultdm_on_systemd.diff
+++ xdm-1.1.11/debian/patches/dont_override_defaultdm_on_systemd.diff
@@ -0,0 +1,17 @@
+Description: Ensure we are starting slim under systemd only when selected
+Author: Didier Roche <didro...@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/748668
+Index: xdm-1.1.11/xdm.service.in
+===================================================================
+--- xdm-1.1.11.orig/xdm.service.in
++++ xdm-1.1.11/xdm.service.in
+@@ -3,7 +3,7 @@ Description=X-Window Display Manager
+ After=systemd-user-sessions.service
+ 
+ [Service]
++ExecStartPre=/bin/sh -c '[ "$(cat /etc/X11/default-display-manager 
2>/dev/null)" = "BINDIR/xdm" ]'
+ ExecStart=BINDIR/xdm -nodaemon
++Restart=always
+ 
+-[Install]
+-Alias=graphical.target.wants/xdm.service

Reply via email to