aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-01-02 14:34:51 +0000
committerJo-Philipp Wich <jo@mein.io>2018-01-02 17:02:44 +0100
commit37bb463daa21e2c97365c6543b2bfdfe673c5baa (patch)
tree20c22361ac44dfe79971d1862698ac23d79ca590 /package/system/procd/files
parent3804f5743df2fbc02ed29557a8782a4bcce88058 (diff)
downloadupstream-37bb463daa21e2c97365c6543b2bfdfe673c5baa.tar.gz
upstream-37bb463daa21e2c97365c6543b2bfdfe673c5baa.tar.bz2
upstream-37bb463daa21e2c97365c6543b2bfdfe673c5baa.zip
procd: procd_send_signal use signal names
Usage documentation for 'procd_send_signal' states "The signal is SIGHUP by default, and must be specified by NAME." Make actual behaviour match the stated documented behaviour. https://wiki.openwrt.org/inbox/procd-init-scripts Suggested-by: Jo-Philip Wich <jow@mein.io> Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Diffstat (limited to 'package/system/procd/files')
-rw-r--r--package/system/procd/files/procd.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index b8d3513b1e..b4b6faa662 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -413,6 +413,10 @@ _procd_send_signal() {
local instance="$2"
local signal="$3"
+ case "$signal" in
+ [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;;
+ esac
+
json_init
json_add_string name "$service"
[ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance"