Skip to content

Commit

Permalink
update post/pre script to detect systemd and behaviour properly
Browse files Browse the repository at this point in the history
  • Loading branch information
metalefty committed May 20, 2016
1 parent 73f4b45 commit de1c566
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
18 changes: 14 additions & 4 deletions debian/postinst
@@ -1,11 +1,21 @@
#!/bin/sh
[ -z "$(pidof systemd)" ] && \
USING_SYSTEMD=false || \
USING_SYSTEMD=true

case "$1" in
configure)
# create the rc.d calls for startup/shutdown...
update-rc.d xrdp defaults
# Crank the engine ;)
invoke-rc.d xrdp start
if $USING_SYSTEMD
then
systemctl daemon-reload
systemctl enable xrdp
systemctl start xrdp
else
# create the rc.d calls for startup/shutdown...
update-rc.d xrdp defaults
# Crank the engine ;)
invoke-rc.d xrdp start
fi
;;
esac
exit 0
14 changes: 12 additions & 2 deletions debian/prerm
@@ -1,8 +1,18 @@
#!/bin/sh
[ -z "$(pidof systemd)" ] && \
USING_SYSTEMD=false || \
USING_SYSTEMD=true

case "$1" in
remove|purge)
invoke-rc.d xrdp stop
update-rc.d xrdp remove
if $USING_SYSTEMD
then
systemctl stop xrdp
systemctl daemon-reload
else
invoke-rc.d xrdp stop
update-rc.d xrdp remove
fi
;;
esac
exit 0

0 comments on commit de1c566

Please sign in to comment.