summaryrefslogtreecommitdiffstats
path: root/ubuntu/maverick/tdebase/debian/tdm-trinity.postinst
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-07-24 02:16:36 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-07-24 02:17:00 +0200
commite1a5231c98a1e7e9cae92fbd84cb2848c615a1a7 (patch)
tree79b35d7b5d569fc86e30dfb9f04caf2df19081df /ubuntu/maverick/tdebase/debian/tdm-trinity.postinst
parentf490f5210b1597b85d66ae1fd54a51bdab7ca779 (diff)
downloadtde-packaging-e1a5231c98a1e7e9cae92fbd84cb2848c615a1a7.tar.gz
tde-packaging-e1a5231c98a1e7e9cae92fbd84cb2848c615a1a7.zip
Add systemd unit for tdm-trinity on Ubuntu
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'ubuntu/maverick/tdebase/debian/tdm-trinity.postinst')
-rw-r--r--ubuntu/maverick/tdebase/debian/tdm-trinity.postinst33
1 files changed, 33 insertions, 0 deletions
diff --git a/ubuntu/maverick/tdebase/debian/tdm-trinity.postinst b/ubuntu/maverick/tdebase/debian/tdm-trinity.postinst
index 84345e28b..4977c4998 100644
--- a/ubuntu/maverick/tdebase/debian/tdm-trinity.postinst
+++ b/ubuntu/maverick/tdebase/debian/tdm-trinity.postinst
@@ -44,6 +44,25 @@ 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
+ 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
db_stop
@@ -122,6 +141,20 @@ case "$1" in
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#
+# Upstart is not active?
+if [ -z "$UPSTART_ACTIVE" ]; then
+ rm /sbin/initctl
+ dpkg-divert --local --rename --remove /sbin/initctl
+fi
+
exit 0