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
|
job_exit = 0 # Exit successfully by default
|
||||||
|
|
||||||
svc::cleanup() {
|
svc::cleanup() {
|
||||||
|
nullexec "${service_stop_command[@]}"
|
||||||
|
anywait "$job_pid" "$service_stop_timeout"
|
||||||
|
|
||||||
# Cgroup stuff, experimental and pretty much deprecated.
|
# Cgroup stuff, experimental and pretty much deprecated.
|
||||||
if cgroups; then
|
if cgroups; then
|
||||||
if service_cgroup_cleanup; then
|
if service_cgroup_cleanup; then
|
||||||
@@ -193,13 +196,7 @@ svc() {
|
|||||||
|
|
||||||
# Die
|
# Die
|
||||||
die "$job_exit"
|
die "$job_exit"
|
||||||
}; trap 'svc::cleanup' EXIT
|
}; trap 'svc::cleanup' TERM EXIT
|
||||||
|
|
||||||
svc::stop_job() {
|
|
||||||
nullexec "${service_stop_command[@]}"
|
|
||||||
|
|
||||||
anywait "$job_pid" "$service_stop_timeout"
|
|
||||||
}; trap 'svc::stop_job' TERM
|
|
||||||
|
|
||||||
printf '%s' "$BASHPID" > "$svc_pidfile"
|
printf '%s' "$BASHPID" > "$svc_pidfile"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user