Browse Source

debian/patches/fix-systemd-service.patch, debian/slim.posinst:

- ensure we are starting slim under systemd only when selected as
 default. (Closes: #748668)
tags/upstream/1.3.6
Mateusz Łukasik 6 years ago
parent
commit
068bb7f11d
3 changed files with 38 additions and 9 deletions
  1. +4
    -0
      debian/changelog
  2. +16
    -9
      debian/patches/fix-systemd-service.patch
  3. +18
    -0
      debian/slim.postinst

+ 4
- 0
debian/changelog View File

@@ -14,6 +14,10 @@ slim (1.3.6-4) UNRELEASED; urgency=medium
- Add fix-hyphen-used-as-minus-sign.patch for like the name call.
- Update debian/copyright.
- Add lintian-overrides for warnigs which can be ignored.
* Rewrite debian/patches/fix-systemd-service.patch, debian/slim.posinst:
- ensure we are starting slim under systemd only when selected as
default. Thanks Didier Roche <didrocks@ubuntu.com> for suggests patch.
(Closes: #748668)

-- Mateusz Łukasik <mati75@linuxmint.pl> Fri, 19 Dec 2014 20:13:47 +0100



+ 16
- 9
debian/patches/fix-systemd-service.patch View File

@@ -1,11 +1,18 @@
Description: Add WantedBy field to systemd slim.service
Author: Mateusz Łukasik <mati75@linuxmint.pl>
Bug-Debian: http://bugs.debian.org/741511
Description: Ensure we are starting slim under systemd only when selected
Author: Didier Roche <didrocks@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

+ 18
- 0
debian/slim.postinst View File

@@ -45,6 +45,24 @@ then
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

Loading…
Cancel
Save