diff --git a/README.md b/README.md index 38ef845..fa79543 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,4 @@ Optional settings (incomplete list): * `service_cgroup_cleanup = no` — Kill the entire cgroup on watchdog cleanup. Note that it is distinctly not the same as killing the cgroup on stopping. * `service_success_exit = 0` — Array. Which exit codes to treat as successful termination. Only works for managed services (With no custom pidfile). * `service_oneshot = no` — The service is supposed to do something and die instead of daemonizing. +* `service_signals_passthru` — Array, empty by default. Which signals should the svc pass directly to the service mainpid. This is dangerous, use with caution. diff --git a/ssm b/ssm index 580180d..16a06a2 100755 --- a/ssm +++ b/ssm @@ -185,6 +185,8 @@ svc() { fi fi + run_service_action 'cleanup' + rm -f "$svc_pidfile" "$service_pidfile" "$service_ready_flag" die 0 @@ -219,6 +221,9 @@ svc() { fi fi + # Some setup might be required on each loop + run_service_action 'setup' + # Spawn the process and record the PID spawn "$@" & job_pid = "$!" @@ -428,7 +433,7 @@ start() { else svc "${service_command[@]}" & - if timer "$service_ready_timeout" ready; then + if timer "$service_ready_timeout" run_service_action 'ready'; then set_ready else return 5