Add systemd unit for tdm-trinity on Ubuntu

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e1a5231c98)
pull/92/head
Slávek Banko 9 years ago
parent a69ee1355f
commit 0be9f6f644

@ -44,6 +44,25 @@ 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
SERVICE=`echo "$SERVICE" | sed "s/tdm\./tdm-trinity./"`
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
@ -122,6 +141,20 @@ case "$1" in
esac esac
# Upstart is not active?
UPSTART_ACTIVE=`dbus-send --system --print-reply --dest=com.ubuntu.Upstart /com/ubuntu/Upstart org.freedesktop.DBus.Properties.Get string:com.ubuntu.Upstart0_6 string:version 2>/dev/null || true`
if [ -z "$UPSTART_ACTIVE" ]; then
echo "Upstart is not active - masking initctl" >&2
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
fi
#DEBHELPER# #DEBHELPER#
# Upstart is not active?
if [ -z "$UPSTART_ACTIVE" ]; then
rm /sbin/initctl
dpkg-divert --local --rename --remove /sbin/initctl
fi
exit 0 exit 0

@ -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