Merge pull request #60379 from c0bw3b/pkg/service-wrapper
service-wrapper: 16.04.0 -> 19.04
This commit is contained in:
commit
43b0f81346
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
name = "service-wrapper-${version}";
|
name = "service-wrapper-${version}";
|
||||||
version = "16.04.0"; # Ajar to Ubuntu Release
|
version = "19.04"; # Akin to Ubuntu Release
|
||||||
in
|
in
|
||||||
runCommand "${name}" {
|
runCommand "${name}" {
|
||||||
script = substituteAll {
|
script = substituteAll {
|
||||||
@ -17,6 +17,7 @@ runCommand "${name}" {
|
|||||||
license = licenses.gpl2Plus;
|
license = licenses.gpl2Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = with maintainers; [ DerTim1 ];
|
maintainers = with maintainers; [ DerTim1 ];
|
||||||
|
# Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
|
@ -41,7 +41,7 @@ is_ignored_file() {
|
|||||||
return 1
|
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 | \
|
USAGE="Usage: "$(@coreutils@/bin/basename $0)" < option > | --status-all | \
|
||||||
[ service_name [ command | --full-restart ] ]"
|
[ service_name [ command | --full-restart ] ]"
|
||||||
SERVICE=
|
SERVICE=
|
||||||
@ -133,29 +133,6 @@ while [ $# -gt 0 ]; do
|
|||||||
esac
|
esac
|
||||||
done
|
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() {
|
run_via_sysvinit() {
|
||||||
# Otherwise, use the traditional sysvinit
|
# Otherwise, use the traditional sysvinit
|
||||||
if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
|
if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
|
||||||
@ -198,7 +175,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "${ACTION}" in
|
case "${ACTION}" in
|
||||||
restart|status)
|
restart|status|try-restart)
|
||||||
exec systemctl $sctl_args ${ACTION} ${UNIT}
|
exec systemctl $sctl_args ${ACTION} ${UNIT}
|
||||||
;;
|
;;
|
||||||
start|stop)
|
start|stop)
|
||||||
@ -214,7 +191,7 @@ then
|
|||||||
exec systemctl $sctl_args ${ACTION} ${UNIT}
|
exec systemctl $sctl_args ${ACTION} ${UNIT}
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
_canreload="$(SYSTEMCTL -p CanReload show ${UNIT} 2>/dev/null)"
|
_canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)"
|
||||||
if [ "$_canreload" = "CanReload=no" ]; then
|
if [ "$_canreload" = "CanReload=no" ]; then
|
||||||
# The reload action falls back to the sysv init script just in case
|
# The reload action falls back to the sysv init script just in case
|
||||||
# the systemd service file does not (yet) support reload for a
|
# the systemd service file does not (yet) support reload for a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user