Here is the v2 version of the slim patch:
- I removed the plymouth-quit.service as it's not related to the bug (and we'll handle the boot nicer in jessie+1)
- also a typo fix between /usr/sbin and /usr/bin

Cheers,
Didier
diff -Nru slim-1.3.6/debian/changelog slim-1.3.6/debian/changelog
--- slim-1.3.6/debian/changelog 2014-04-29 13:18:36.000000000 +0200
+++ slim-1.3.6/debian/changelog 2014-11-25 16:03:47.000000000 +0100
@@ -1,3 +1,11 @@
+slim (1.3.6-4) UNRELEASED; urgency=medium
+
+  * debian/patches/fix-systemd-service.patch, debian/slim.posinst:
+    - ensure we are starting slim under systemd only when selected as
+      default. (Closes: #748668)
+
+ -- Didier Roche <didro...@ubuntu.com>  Tue, 25 Nov 2014 16:02:43 +0100
+
 slim (1.3.6-3) unstable; urgency=high
 
   * debian/patches:
diff -Nru slim-1.3.6/debian/patches/fix-systemd-service.patch 
slim-1.3.6/debian/patches/fix-systemd-service.patch
--- slim-1.3.6/debian/patches/fix-systemd-service.patch 2014-03-14 
23:01:58.000000000 +0100
+++ slim-1.3.6/debian/patches/fix-systemd-service.patch 2014-11-25 
16:31:21.000000000 +0100
@@ -1,11 +1,18 @@
-Description: Add WantedBy field to systemd slim.service
-Author: Mateusz Łukasik <mat...@linuxmint.pl>
-Bug-Debian: http://bugs.debian.org/741511
+Description: Ensure we are starting slim under systemd only when selected
+Author: Didier Roche <didro...@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/748668
 
---- a/slim.service
-+++ b/slim.service
-@@ -7,3 +7,4 @@ ExecStart=/usr/bin/slim -nodaemon
+Index: slim-1.3.6/slim.service
+===================================================================
+--- slim-1.3.6.orig/slim.service
++++ slim-1.3.6/slim.service
+@@ -3,7 +3,6 @@ Description=SLiM Simple Login Manager
+ After=systemd-user-sessions.service
  
- [Install]
- Alias=display-manager.service
-+WantedBy=graphical.target
+ [Service]
++ExecStartPre=/bin/sh -c '[ "$(cat /etc/X11/default-display-manager 
2>/dev/null)" = "/usr/bin/slim" ]'
+ ExecStart=/usr/bin/slim -nodaemon
+-
+-[Install]
+-Alias=display-manager.service
++Restart=always
diff -Nru slim-1.3.6/debian/slim.postinst slim-1.3.6/debian/slim.postinst
--- slim-1.3.6/debian/slim.postinst     2014-01-08 19:18:55.000000000 +0100
+++ slim-1.3.6/debian/slim.postinst     2014-11-25 16:00:51.000000000 +0100
@@ -45,6 +45,24 @@
   invoke-rc.d dbus reload || true
 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
+
 #DEBHELPER#
 
 exit 0

Reply via email to