summary refs log tree commit diff
path: root/pkgs/os-specific/linux/service-wrapper
diff options
context:
space:
mode:
authorc0bw3b <c0bw3b@users.noreply.github.com>2019-04-28 18:35:34 +0200
committerc0bw3b <c0bw3b@users.noreply.github.com>2019-04-28 18:35:34 +0200
commit3aa6b25fdf1be00afbc82c22329cfbb10dd08a61 (patch)
tree08d16e0650fd498d3bafef3126674d9e3b7891b2 /pkgs/os-specific/linux/service-wrapper
parent7d558b2cdfe43f7bb90ee2f47890149181395d6f (diff)
downloadnixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar.gz
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar.bz2
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar.lz
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar.xz
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.tar.zst
nixpkgs-3aa6b25fdf1be00afbc82c22329cfbb10dd08a61.zip
service-wrapper: 16.04.0 -> 19.04
Diffstat (limited to 'pkgs/os-specific/linux/service-wrapper')
-rw-r--r--pkgs/os-specific/linux/service-wrapper/default.nix3
-rwxr-xr-xpkgs/os-specific/linux/service-wrapper/service-wrapper.sh29
2 files changed, 5 insertions, 27 deletions
diff --git a/pkgs/os-specific/linux/service-wrapper/default.nix b/pkgs/os-specific/linux/service-wrapper/default.nix
index 8adb2e5413c..f2ed3c4a783 100644
--- a/pkgs/os-specific/linux/service-wrapper/default.nix
+++ b/pkgs/os-specific/linux/service-wrapper/default.nix
@@ -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
   };
 }
 ''
diff --git a/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh b/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
index 460bf678e6a..a7c3bc9758b 100755
--- a/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
+++ b/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
@@ -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