Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update post/pre script to detect systemd and behaviour properly
- Loading branch information
Showing
2 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |