mirror of
https://github.com/troglobit/finit.git
synced 2026-11-13 17:00:16 +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
@@ -461,6 +461,9 @@ restart:
|
||||
/* First reload all *.conf in /etc/finit.d/ */
|
||||
conf_reload();
|
||||
|
||||
/* Handle remain tasks that need to run post script before restart */
|
||||
service_runtask_clean();
|
||||
|
||||
/*
|
||||
* Then, mark all affected service conditions as in-flux and
|
||||
* let all affected services move to WAITING/HALTED
|
||||
|
||||
Reference in new issue
Block a user