Add systemd unit for tdm-trinity on Debian

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 8 years ago
parent 345baa6611
commit dd7fe04417

@ -1,4 +1,5 @@
debian/local/tdm.options etc/trinity/tdm/ debian/local/tdm.options etc/trinity/tdm/
debian/tdm.service lib/systemd/system/
debian/tmp/etc/trinity/tdm/tdmrc debian/tmp/etc/trinity/tdm/tdmrc
debian/tmp/etc/trinity/tdm/Xaccess debian/tmp/etc/trinity/tdm/Xaccess
debian/tmp/etc/trinity/tdm/Xreset debian/tmp/etc/trinity/tdm/Xreset

@ -44,6 +44,24 @@ if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" ]; then
rm "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" rm "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
fi 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 # restarting the daemon may cause output to stdout
db_stop db_stop
@ -126,17 +144,23 @@ if [ -x "/etc/init.d/tdm-trinity" ]; then
if [ -x "`which insserv 2>/dev/null`" ]; then if [ -x "`which insserv 2>/dev/null`" ]; then
insserv tdm-trinity >/dev/null insserv tdm-trinity >/dev/null
else 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
fi fi
if [ -n "$NOSTART" ]; then if [ -n "$NOSTART" ]; then
exit 0 exit 0
else else
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then if [ -x "`which service 2>/dev/null`" ]; then
invoke-rc.d tdm-trinity start || true service tdm-trinity start || true
else 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
fi fi

@ -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
Loading…
Cancel
Save