mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 10:39:04 +00:00
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>
(cherry picked from commit 2ac1a57677
)
This commit is contained in:
parent
5970e6d466
commit
0f47ce8180
@ -23,6 +23,7 @@ reload() {
|
|||||||
restart() {
|
restart() {
|
||||||
trap '' TERM
|
trap '' TERM
|
||||||
stop "$@"
|
stop "$@"
|
||||||
|
trap - TERM
|
||||||
start "$@"
|
start "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user