summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/squeeze/tdebase/debian/tdm-trinity.install1
-rw-r--r--debian/squeeze/tdebase/debian/tdm-trinity.postinst32
-rw-r--r--debian/squeeze/tdebase/debian/tdm.service12
3 files changed, 41 insertions, 4 deletions
diff --git a/debian/squeeze/tdebase/debian/tdm-trinity.install b/debian/squeeze/tdebase/debian/tdm-trinity.install
index afcf37d7b..b69800a6f 100644
--- a/debian/squeeze/tdebase/debian/tdm-trinity.install
+++ b/debian/squeeze/tdebase/debian/tdm-trinity.install
@@ -1,4 +1,5 @@
debian/local/tdm.options etc/trinity/tdm/
+debian/tdm.service lib/systemd/system/
debian/tmp/etc/trinity/tdm/tdmrc
debian/tmp/etc/trinity/tdm/Xaccess
debian/tmp/etc/trinity/tdm/Xreset
diff --git a/debian/squeeze/tdebase/debian/tdm-trinity.postinst b/debian/squeeze/tdebase/debian/tdm-trinity.postinst
index 282662484..878244fca 100644
--- a/debian/squeeze/tdebase/debian/tdm-trinity.postinst
+++ b/debian/squeeze/tdebase/debian/tdm-trinity.postinst
@@ -44,6 +44,24 @@ if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" ]; then
rm "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
fi
+# set default-display-manager systemd service link according to our config
+DEFAULT_SERVICE=/etc/systemd/system/display-manager.service
+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
+
# restarting the daemon may cause output to stdout
db_stop
@@ -126,17 +144,23 @@ if [ -x "/etc/init.d/tdm-trinity" ]; then
if [ -x "`which insserv 2>/dev/null`" ]; then
insserv tdm-trinity >/dev/null
else
- update-rc.d tdm-trinity defaults 13 01 >/dev/null
+ if [ -x "`which update-rc.d 2>/dev/null`" ]; then
+ update-rc.d tdm-trinity defaults 13 01 >/dev/null
+ fi
fi
fi
if [ -n "$NOSTART" ]; then
exit 0
else
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d tdm-trinity start || true
+ if [ -x "`which service 2>/dev/null`" ]; then
+ service tdm-trinity start || true
else
- /etc/init.d/tdm-trinity start || true
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ invoke-rc.d tdm-trinity start || true
+ else
+ /etc/init.d/tdm-trinity start || true
+ fi
fi
fi
diff --git a/debian/squeeze/tdebase/debian/tdm.service b/debian/squeeze/tdebase/debian/tdm.service
new file mode 100644
index 000000000..349823a9f
--- /dev/null
+++ b/debian/squeeze/tdebase/debian/tdm.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Trinity Display Manager
+Documentation=man:tdm-trinity(1)
+Conflicts=getty@tty7.service plymouth-quit.service
+After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service
+
+[Service]
+# temporary safety check until all DMs are converted to correct
+# display-manager.service symlink handling
+ExecStartPre=/bin/sh -c '[ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "tdm" ]'
+ExecStart=/opt/trinity/bin/tdm
+Restart=always