[source] procd: procd_send_signal use signal names
LEDE Commits
lede-commits at lists.infradead.org
Tue Jan 2 08:02:51 PST 2018
jow pushed a commit to source.git, branch master:
https://git.lede-project.org/37bb463daa21e2c97365c6543b2bfdfe673c5baa
commit 37bb463daa21e2c97365c6543b2bfdfe673c5baa
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Tue Jan 2 14:34:51 2018 +0000
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 at mein.io>
Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
package/system/procd/Makefile | 2 +-
package/system/procd/files/procd.sh | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index bffed81..7c8a166 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 b8d3513..b4b6faa 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"
More information about the lede-commits
mailing list