We always know the mainpid, why the cloak & dagger

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2019-11-17 17:48:51 +03:00
parent b67fec6f16
commit a47b00f665

14
ssm
View File

@ -176,7 +176,6 @@ cgroup_get_procs() {
}; readonly -f cgroup_get_procs }; readonly -f cgroup_get_procs
## Run the command and wait for it to die ## Run the command and wait for it to die
svc() { svc() {
declare job_pid job_exit job_success last_respawn fail_counter date counter p declare job_pid job_exit job_success last_respawn fail_counter date counter p
var job_pid job_exit job_success last_respawn fail_counter date counter p var job_pid job_exit job_success last_respawn fail_counter date counter p
@ -212,16 +211,6 @@ svc() {
die "$job_exit" die "$job_exit"
}; trap 'svc::cleanup' TERM }; trap 'svc::cleanup' TERM
svc::reload() {
nullexec kill -n "$service_reload_signal" "$job_pid"
}; trap 'svc::reload' HUP
# Signals to pass through to the mainpid.
svc::passthru() { kill -n "$1" "$2"; }
for s in "${service_signals_passthru[@]}"; do
trap "svc::passthru $s \$job_pid" "$s"
done
printf '%s' $BASHPID > "$svc_pidfile" printf '%s' $BASHPID > "$svc_pidfile"
# Cgroups # Cgroups
@ -471,8 +460,7 @@ start() {
## Usually just sends HUP ## Usually just sends HUP
reload() { reload() {
service_running || return 3 service_running || return 3
nullexec kill -n "$service_reload_signal" "$service_pid"
kill -n 1 "$svc_pid"
} }
## Stop the service ## Stop the service