summaryrefslogtreecommitdiffabout
path: root/src/prog.h
authorSergey Poznyakoff <gray@gnu.org>2016-02-13 19:27:11 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-02-13 19:46:32 (GMT)
commitc9581808b72ff25623c87cf49c471ce7f017985d (patch) (side-by-side diff)
tree3b6c7143eec966561e24c05ffb87e1d55b4acf58 /src/prog.h
parent3c774556e22cd30c42304614e14218a767e4d700 (diff)
downloadpies-c9581808b72ff25623c87cf49c471ce7f017985d.tar.gz
pies-c9581808b72ff25623c87cf49c471ce7f017985d.tar.bz2
Stop disabled components when switching runlevels.
* src/prog.h (status_enabled, status_disabled): Remove. (status_stopped, status_running): New modes. All uses updated. * src/comp.c (component_finish): Disable ondemand component by default. * src/ctl.c (json_object_set_bool): New function. (pies_status_str): Update. (prog_serialize): Set "disabled" attribute. (fun_stop, fun_start): Use CF_DISABLED flag. (res_runlevel): Schedule ACTION_RELOAD. * src/pies.h (json_object_set_bool): New proto. * src/piesctl.c (status_trans): Reflect changes in modes. (print_comp): Check the "disabled" attribute. * src/progman.c (register_prog0) (prog_open_socket,prog_start,prog_stop) (progman_wake_sleeping) (prog_start_prerequisites) (react, progman_cleanup) (progman_stop_component): Update. (no_children_left): Fix. * src/sysvinit.c (enablecomp): Make CF_DISABLED flag persist for ondemand components. (runlevel_setup_prog): Use CF_DISABLED flag. (inittrans): Stop inactivated processes. * doc/pies.texi: Update.
Diffstat (limited to 'src/prog.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/prog.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/prog.h b/src/prog.h
index 2dc8591..1db2eee 100644
--- a/src/prog.h
+++ b/src/prog.h
@@ -23,9 +23,8 @@ enum prog_type
enum prog_status
{
- status_enabled, /* Component enabled. prog->pid!=0 shows if it is
- actually running */
- status_disabled, /* Component is disabled. */
+ status_stopped, /* Component is stopped. */
+ status_running, /* Component is running */
status_listener, /* Component is an inetd listener */
status_sleeping, /* Component is sleeping. An attempt to start it will
be made at prog->v.p.timestamp + SLEEPTIME */
@@ -60,7 +59,7 @@ struct prog
enum prog_status status; /* Current component status */
/* If status == status_listener: */
size_t num_instances; /* Number of running instances */
- /* If comp->type == pies_comp_inetd && status == status_enabled */
+ /* If comp->type == pies_comp_inetd && status == status_running */
struct prog *listener;
union pies_sockaddr_storage sa_storage;
size_t sa_len;

Return to:

Send suggestions and report system problems to the System administrator.