aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorLinus Kardell <linus@telliq.com>2018-11-22 11:35:08 +0100
committerLinus Kardell <linus@telliq.com>2018-11-22 13:15:10 +0100
commit2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58 (patch)
tree8b2a12c7d225e8704ca65de2ebe7e1f956e24e4f /package/base-files
parent3a1978bbb412320c087ff506d49c7cd23dd60d60 (diff)
downloadupstream-2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58.tar.gz
upstream-2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58.tar.bz2
upstream-2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58.zip
base-files: fix unkillable processes after restart
When restart is run on an init script, the script traps SIGTERM. This is done as a workaround for scripts named the same name as the program they start. In that case, the init script process will have the same name as the program process, and so when the init script runs killall, it will kill itself. So SIGTERM is trapped to make the init script unkillable. However, the trap is retained when the init script runs start, and thus processes started by restart will not respond to SIGTERM, and will thus be unkillable unless you use SIGKILL. This fixes that by removing the trap before running start. Signed-off-by: Linus Kardell <linus@telliq.com>
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/etc/rc.common1
1 files changed, 1 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 3e237170b4..d9773a0c5a 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -23,6 +23,7 @@ reload() {
restart() {
trap '' TERM
stop "$@"
+ trap - TERM
start "$@"
}