From 5ae5a4920bc9f2b9b2404d6e119388e95938cfb2 Mon Sep 17 00:00:00 2001 From: fbt Date: Sun, 29 Nov 2026 16:05:16 +0000 Subject: [PATCH] readme + respawn delay Signed-off-by: fbt --- README.md | 3 +-- ssm | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 726bacb..aa74a8b 100644 --- a/README.md +++ b/README.md @@ -181,8 +181,7 @@ Operators: * `var name is file` / `is dir` / `is directory` / `is fs_object` / `is empty` — filesystem-style tests on the value. * `var name u value` — exit 0 if `value` is one of the array's elements. -* `var name` — no operator: exit 0 unless the variable is unset, empty, or - `false`/`0` (compared case-insensitively). +* `var name` — create the accessor function and exit. * `name++` / `name--` — increment/decrement the first element. * `var name -v other_name` — build the accessor for `other_name` instead of `name` (so `name` acts on `other_name`). diff --git a/ssm b/ssm index 2620e5e..5a628bb 100755 --- a/ssm +++ b/ssm @@ -296,6 +296,9 @@ svc() { # Record the time every time we restart the loop printf -v last_respawn '%(%s)T' + + # Sleep a bit between restarts + sleep "$service_respawn_delay" done #svc::cleanup @@ -668,6 +671,7 @@ var XDG_RUNTIME_DIR := "/run/user/$UID" ## Let's set some defaults # These are meaningful to reconfigure. var service_respawn = 'no' # Respawn the service if it exits +var service_respawn_delay = 1 # Wait a bit between restarts var service_workdir = '/' var service_stop_timeout = 30 var service_stop_command = kill -n "\$service_stop_signal" "\$job_pid"