mirror of
https://github.com/troglobit/finit.git
synced 2026-10-31 13:00:32 +00:00
Rename internal run/task/service states => changes condition names
This patch renames the internal states for run/task/services to avoid
any confusion with the introduction of 'ready:scripts'.
* WAITING -> PAUSED
* READY -> WAITING
A service condition that used, e.g., <service/foo/ready> should now
instead use <service/foo/waiting>.
Note: A new condition with the old name <service/foo/ready> will be
introduced shortly to signify service "readiness", a concept
used in other PID 1, like systemd and s6.
For details, see issue #299.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
9d79673cea
commit
51ade57723
6 files changed
+20
-20
No files matched your search
+6
-6
@@ -1993,14 +1993,14 @@ restart:
|
||||
switch (svc->state) {
|
||||
case SVC_HALTED_STATE:
|
||||
if (enabled)
|
||||
svc_set_state(svc, SVC_READY_STATE);
|
||||
svc_set_state(svc, SVC_WAITING_STATE);
|
||||
break;
|
||||
|
||||
case SVC_DONE_STATE:
|
||||
if (svc_is_changed(svc))
|
||||
svc_set_state(svc, SVC_HALTED_STATE);
|
||||
if (svc_is_runtask(svc) && svc_is_manual(svc) && enabled)
|
||||
svc_set_state(svc, SVC_READY_STATE);
|
||||
svc_set_state(svc, SVC_WAITING_STATE);
|
||||
break;
|
||||
|
||||
case SVC_STOPPING_STATE:
|
||||
@@ -2046,7 +2046,7 @@ restart:
|
||||
svc_set_state(svc, SVC_STARTING_STATE);
|
||||
break;
|
||||
|
||||
case SVC_READY_STATE:
|
||||
case SVC_WAITING_STATE:
|
||||
if (!enabled) {
|
||||
svc_set_state(svc, SVC_HALTED_STATE);
|
||||
} else if (cond_get_agg(svc->cond) == COND_ON) {
|
||||
@@ -2125,7 +2125,7 @@ restart:
|
||||
|
||||
case COND_FLUX:
|
||||
kill(svc->pid, SIGSTOP);
|
||||
svc_set_state(svc, SVC_WAITING_STATE);
|
||||
svc_set_state(svc, SVC_PAUSED_STATE);
|
||||
break;
|
||||
|
||||
case COND_ON:
|
||||
@@ -2148,7 +2148,7 @@ restart:
|
||||
}
|
||||
break;
|
||||
|
||||
case SVC_WAITING_STATE:
|
||||
case SVC_PAUSED_STATE:
|
||||
if (!enabled) {
|
||||
kill(svc->pid, SIGCONT);
|
||||
service_stop(svc);
|
||||
@@ -2157,7 +2157,7 @@ restart:
|
||||
|
||||
if (!svc->pid) {
|
||||
(*restart_cnt)++;
|
||||
svc_set_state(svc, SVC_READY_STATE);
|
||||
svc_set_state(svc, SVC_WAITING_STATE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user