mirror of
https://github.com/troglobit/finit.git
synced 2026-10-26 12:14:37 +00:00
Add remain:yes option for run/task oneshot commands
Similar to systemd's RemainAfterExit=yes. Prevents the task from
re-running on runlevel re-entry and ensures the post: script runs
when explicitly stopped or when leaving valid runlevels.
Useful for tasks that set up persistent state like firewall rules:
task [2345] remain:yes \
post:/usr/sbin/teardown-firewall \
/usr/sbin/setup-firewall -- Firewall setup
Not supported for bootstrap-only tasks (runlevel S only) since these
are deleted immediately after completion.
This commit is contained in:
1 parent
a215747355
commit
5f7e8457af
7 files changed
+121
-4
No files matched your search
@@ -398,6 +398,20 @@ mechanism completely, allows endless restarts. Useful in many
|
||||
use-cases, but not what
|
||||
.Cm service
|
||||
was originally designed for so not the default behavior.
|
||||
.It Cm remain:yes
|
||||
for
|
||||
.Cm run
|
||||
and
|
||||
.Cm task
|
||||
only. Prevents the task from re-running on runlevel re-entry and
|
||||
ensures the
|
||||
.Cm post:
|
||||
script runs when the task is explicitly stopped or leaves its valid
|
||||
runlevels. Similar to systemd's
|
||||
.Cm RemainAfterExit=yes .
|
||||
.Pp
|
||||
.Sy Note:
|
||||
not supported for bootstrap-only tasks (runlevels [S] only).
|
||||
.It Cm oncrash:reboot
|
||||
when all retries have failed, and the service
|
||||
has
|
||||
|
||||
Reference in new issue
Block a user