diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-10-05 18:49:33 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-10-05 18:49:52 +0200 |
commit | 1e29387fa08f6bfb513e8ae1fdc63f19bde87435 (patch) | |
tree | c31ae997bb139c0a5740055e99d606a097e31592 /debian/squeeze/tdebase | |
parent | a445d8e1200ddef3b5d88140e38a0cc2f28ba3b5 (diff) | |
download | tde-packaging-1e29387fa08f6bfb513e8ae1fdc63f19bde87435.tar.gz tde-packaging-1e29387fa08f6bfb513e8ae1fdc63f19bde87435.zip |
Add systemd unit for tdm-trinity on Debian
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dd7fe0441730ccec3d5040e7f863cfdc7aaef6b2)
Diffstat (limited to 'debian/squeeze/tdebase')
-rw-r--r-- | debian/squeeze/tdebase/debian/tdm-trinity.install | 1 | ||||
-rw-r--r-- | debian/squeeze/tdebase/debian/tdm-trinity.postinst | 32 | ||||
-rw-r--r-- | debian/squeeze/tdebase/debian/tdm.service | 12 |
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 |