summaryrefslogtreecommitdiffabout
path: root/src/ctl.c
authorSergey Poznyakoff <gray@gnu.org>2016-01-31 14:40:27 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-01-31 14:40:27 (GMT)
commitd9d267052215f223897af18310e4adee310308e7 (patch) (side-by-side diff)
tree6b6f9eb636975f5721e00d2d71007185fa5b2fbf /src/ctl.c
parent6f9f2fd7a6952b544dccbf0bdc7f9c312f602afe (diff)
downloadpies-d9d267052215f223897af18310e4adee310308e7.tar.gz
pies-d9d267052215f223897af18310e4adee310308e7.tar.bz2
Support sysvinit ondemand components.
* src/ctl.c (fun_start): Handle status_finished same as status_sleeping (for restarting ondemand components). * src/progman.c: Respawn ondemand components. * src/sysvinit.c (enablecomp): Handle pies_comp_ondemand. (sysvinit_demand): New function. (sysvinit_fifo_handler): Handle ondemand runlevels. (inittab_parse): Support "off" fields. Convert runlevels to upper case.
Diffstat (limited to 'src/ctl.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ctl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 0e5ea97..489fc7f 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1878,4 +1878,5 @@ fun_start (struct json_value *result, struct prog *prog)
{
- if (prog->v.p.status == status_disabled)
+ switch (prog->v.p.status)
{
+ case status_disabled:
prog->v.p.comp->flags &= ~CF_DISABLED;
@@ -1883,5 +1884,6 @@ fun_start (struct json_value *result, struct prog *prog)
json_object_set_string (result, "status", "OK");
- }
- else if (prog->v.p.status == status_sleeping)
- {
+ break;
+
+ case status_sleeping:
+ case status_finished:
prog->v.p.status = status_enabled;
@@ -1890,5 +1892,5 @@ fun_start (struct json_value *result, struct prog *prog)
json_object_set_string (result, "status", "OK");
- }
- else
- {
+ break;
+
+ default:
json_object_set_string (result, "status", "ER");

Return to:

Send suggestions and report system problems to the System administrator.