Another oops
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
08b7d5631d
commit
3c6fb9796b
11
ssm
11
ssm
|
@ -26,11 +26,10 @@ svc() {
|
|||
declare job_pid
|
||||
|
||||
svc::cleanup() {
|
||||
kill -n "$service_stop_signal" "$job_pid"
|
||||
"${service_command_stop[@]}"
|
||||
|
||||
pid_wait "$job_pid" && {
|
||||
pid_wait "$job_pid"
|
||||
rm -f "$svc_pidfile" "$service_ready_flag"
|
||||
}
|
||||
}; trap 'svc::cleanup' TERM
|
||||
|
||||
"$@" & job_pid=$!
|
||||
|
@ -281,7 +280,11 @@ stop() {
|
|||
else
|
||||
(( service_running )) || return 3
|
||||
|
||||
if (( service_managed )); then
|
||||
nullexec kill "$service_pid" || return 1
|
||||
else
|
||||
"${service_command_stop[@]}" || return 1
|
||||
fi
|
||||
|
||||
pid_wait "$service_pid" || return 5
|
||||
> "$service_stopped_flag"
|
||||
|
@ -425,6 +428,7 @@ main() {
|
|||
}
|
||||
done
|
||||
|
||||
[[ $service_config ]] || {
|
||||
# Search for a systemd service too
|
||||
for i in {/etc/systemd,/run/systemd,/lib/systemd,/usr/lib/systemd}/system/$1.service; do
|
||||
[[ -f "$i" ]] && {
|
||||
|
@ -435,6 +439,7 @@ main() {
|
|||
break
|
||||
}
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
||||
# Die if there is no service config file
|
||||
|
|
Loading…
Reference in New Issue
Block a user