aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-01-02 14:34:51 +0000
committerRafał Miłecki <rafal@milecki.pl>2018-12-11 21:30:54 +0100
commit3e6e33f52831b6a874401fa779e807a451e56137 (patch)
tree435c8f83c0b2605a90b249cf6fea5431a3a88945 /package/system/procd
parente84f289a02b1dbfbda77b5b3ab4dfea94505a5b6 (diff)
downloadupstream-3e6e33f52831b6a874401fa779e807a451e56137.tar.gz
upstream-3e6e33f52831b6a874401fa779e807a451e56137.tar.bz2
upstream-3e6e33f52831b6a874401fa779e807a451e56137.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> (cherry picked from commit 37bb463daa21e2c97365c6543b2bfdfe673c5baa)
Diffstat (limited to 'package/system/procd')
-rw-r--r--package/system/procd/Makefile2
-rw-r--r--package/system/procd/files/procd.sh4
2 files changed, 5 insertions, 1 deletions
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index b905cb25aa..d7b3e47fdb 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=procd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index e6ca8a6bc9..36388adaed 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -383,6 +383,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"