service-wrapper: 16.04.0 -> 19.04

This commit is contained in:
c0bw3b 2019-04-28 18:35:34 +02:00
parent 7d558b2cdf
commit 3aa6b25fdf
2 changed files with 5 additions and 27 deletions

View file

@ -2,7 +2,7 @@
let
name = "service-wrapper-${version}";
version = "16.04.0"; # Ajar to Ubuntu Release
version = "19.04"; # Akin to Ubuntu Release
in
runCommand "${name}" {
script = substituteAll {
@ -17,6 +17,7 @@ runCommand "${name}" {
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ DerTim1 ];
# Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers
};
}
''

View file

@ -41,7 +41,7 @@ is_ignored_file() {
return 1
}
VERSION=$(@coreutils@/bin/basename $0)" ver. 0.91-ubuntu1"
VERSION=$(@coreutils@/bin/basename $0)" ver. 19-04"
USAGE="Usage: "$(@coreutils@/bin/basename $0)" < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
@ -133,29 +133,6 @@ while [ $# -gt 0 ]; do
esac
done
# Operate against system upstart, not session
unset UPSTART_SESSION
if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
&& initctl version 2>/dev/null | grep -q upstart \
&& initctl status ${SERVICE} 2>/dev/null 1>/dev/null
then
# Upstart configuration exists for this job and we're running on upstart
case "${ACTION}" in
start|stop|status|reload)
# Action is a valid upstart action
exec ${ACTION} ${SERVICE} ${OPTIONS}
;;
restart|force-reload)
# Map restart to the usual sysvinit behavior.
# Map force-reload to restart as per Debian policy 9.3.2,
# since there is no way to know if "reload" is supported
stop ${SERVICE} ${OPTIONS} || :
exec start ${SERVICE} ${OPTIONS}
;;
esac
fi
run_via_sysvinit() {
# Otherwise, use the traditional sysvinit
if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
@ -198,7 +175,7 @@ then
fi
case "${ACTION}" in
restart|status)
restart|status|try-restart)
exec systemctl $sctl_args ${ACTION} ${UNIT}
;;
start|stop)
@ -214,7 +191,7 @@ then
exec systemctl $sctl_args ${ACTION} ${UNIT}
;;
reload)
_canreload="$(SYSTEMCTL -p CanReload show ${UNIT} 2>/dev/null)"
_canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)"
if [ "$_canreload" = "CanReload=no" ]; then
# The reload action falls back to the sysv init script just in case
# the systemd service file does not (yet) support reload for a