]> rtime.felk.cvut.cz Git - sojka/debian/lightdm.git/blobdiff - debian/lightdm.postinst
* debian/control:
[sojka/debian/lightdm.git] / debian / lightdm.postinst
index 550d1aa8ce23c65a72c6cf8f66e5f205ebe9c994..cc315efce9e4da947713063757c9d03daac71f59 100644 (file)
@@ -62,6 +62,16 @@ fi
 if [ "$1" = "configure" ];
 then
   invoke-rc.d dbus reload || true
+
+  # set default-display-manager systemd service link according to our config
+  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a -d /etc/systemd/system/ ]; then
+    SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
+    if [ -e "$SERVICE" ]; then
+      ln -sf "$SERVICE" /etc/systemd/system/display-manager.service
+    else
+      echo "ERROR: $SERVICE is the selected default display manager but does not exist" >&2
+    fi
+  fi
 fi
 
 #DEBHELPER#