Yet another service manager. https://fleshless.org/pages/spark.html
Go to file
fbt 7c584eb8ee service path
Signed-off-by: fbt <fbt@fleshless.org>
2021-01-24 19:36:37 +03:00
examples There is no passthru anymore 2020-03-07 18:50:02 +03:00
LICENSE licence and readme 2017-07-13 15:45:56 +03:00
README.md examples, oneshot services rework 2018-03-09 02:31:14 +03:00
ssm service path 2021-01-24 19:36:37 +03:00
ssm-gen oops 2017-03-12 04:34:19 +03:00

ssm

Yet another service manager.

Services

A service is a script in the ssm's init.d directory.
By default it's /etc/ssm/services for system services and $XDG_CONFIG_HOME/ssm/services for user ones.

Note that they are BASH scripts that get sourced by ssm. Same pitfalls apply. Hopefully, you won't have to do complex logic in the services.

Global settings

  • cgroups = 0 — Enable cgroup-related features.

Service config

Mandatory options:

  • service_command = /usr/bin/example -a --long-arg "parameter"

Optional settings (incomplete list):

  • service_respawn = no — Restart the service. Takes no, always, on-failure and on-success.
  • service_workdir = /
  • service_pidfile — If the service manages its own pidfile, set this.
  • service_pidfile_timeout = 15 — How long to wait for the service to create its pidfile.
  • service_pidfile_remove_stale = yes — Remove stale pidfiles before spawning the service process.
  • service_logfile_out = "$logdir/$service_name.log" — Logfile for output.
  • service_logfile_err = "$service_logfile_out" — Logfile for stderr.
  • service_stop_timeout = 30 — How long to wait after sending the stop command.
  • service_ready_timeout = 15 — How long to wait till the service is ready, in seconds.
  • service_stop_signal = 15 — Which signal to send to the service when stopping.
  • service_reload_signal = 1 — Which signal to send to the service when reloading.
  • service_cgroup_exclusive = no — Refuse to start the service if the cgroup is not empty.
  • service_cgroup_wait = no — Wait on the entire cgroup to die when stopping the service.
  • service_cgroup_strict = 1 — Refuse to do anything if the service's recorded PID is both running and not in the service's appropriate cgroup. This usually means you've either found a bug or something bad happened to your system.
  • service_cgroup_kill = no — Kill the entire cgroup when stopping the service.
  • service_cgroup_kill_signal = 15 — Which signal to use for that.
  • 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.

Mind your expansions.