Nevermind, I remember now why this was all one function
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
@@ -165,6 +165,9 @@ svc() {
|
||||
job_exit = 0 # Exit successfully by default
|
||||
|
||||
svc::cleanup() {
|
||||
nullexec "${service_stop_command[@]}"
|
||||
anywait "$job_pid" "$service_stop_timeout"
|
||||
|
||||
# Cgroup stuff, experimental and pretty much deprecated.
|
||||
if cgroups; then
|
||||
if service_cgroup_cleanup; then
|
||||
@@ -193,13 +196,7 @@ svc() {
|
||||
|
||||
# Die
|
||||
die "$job_exit"
|
||||
}; trap 'svc::cleanup' EXIT
|
||||
|
||||
svc::stop_job() {
|
||||
nullexec "${service_stop_command[@]}"
|
||||
|
||||
anywait "$job_pid" "$service_stop_timeout"
|
||||
}; trap 'svc::stop_job' TERM
|
||||
}; trap 'svc::cleanup' TERM EXIT
|
||||
|
||||
printf '%s' "$BASHPID" > "$svc_pidfile"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user