readme + respawn delay

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-29 16:05:16 +00:00
parent b49f4d345e
commit 5ae5a4920b
2 changed files with 5 additions and 2 deletions
+1 -2
View File
@@ -181,8 +181,7 @@ Operators:
* `var name is file` / `is dir` / `is directory` / `is fs_object` / `is empty` — * `var name is file` / `is dir` / `is directory` / `is fs_object` / `is empty` —
filesystem-style tests on the value. filesystem-style tests on the value.
* `var name u value` — exit 0 if `value` is one of the array's elements. * `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 * `var name` — create the accessor function and exit.
`false`/`0` (compared case-insensitively).
* `name++` / `name--` — increment/decrement the first element. * `name++` / `name--` — increment/decrement the first element.
* `var name -v other_name` — build the accessor for `other_name` instead of * `var name -v other_name` — build the accessor for `other_name` instead of
`name` (so `name` acts on `other_name`). `name` (so `name` acts on `other_name`).
+4
View File
@@ -296,6 +296,9 @@ svc() {
# Record the time every time we restart the loop # Record the time every time we restart the loop
printf -v last_respawn '%(%s)T' printf -v last_respawn '%(%s)T'
# Sleep a bit between restarts
sleep "$service_respawn_delay"
done done
#svc::cleanup #svc::cleanup
@@ -668,6 +671,7 @@ var XDG_RUNTIME_DIR := "/run/user/$UID"
## Let's set some defaults ## Let's set some defaults
# These are meaningful to reconfigure. # These are meaningful to reconfigure.
var service_respawn = 'no' # Respawn the service if it exits 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_workdir = '/'
var service_stop_timeout = 30 var service_stop_timeout = 30
var service_stop_command = kill -n "\$service_stop_signal" "\$job_pid" var service_stop_command = kill -n "\$service_stop_signal" "\$job_pid"