summaryrefslogtreecommitdiffabout
path: root/src/ctl.c
authorSergey Poznyakoff <gray@gnu.org>2016-02-28 18:42:50 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-02-28 19:39:28 (GMT)
commit0d0a148121dcb8edd49cad900f27141336576f9d (patch) (side-by-side diff)
treed458628bb80d5972f540826e1cf3fc8b8224265b /src/ctl.c
parent14e0802da5587179607f3340d105914435ee117a (diff)
downloadpies-0d0a148121dcb8edd49cad900f27141336576f9d.tar.gz
pies-0d0a148121dcb8edd49cad900f27141336576f9d.tar.bz2
Synchronize changes in runlevel with configuration reloads
State transition algorithm used this far could cause spurious component wakeups in some cases. Consider the following scenario: being in runlevel N, the configuration is changed so that a component X is added at runlevel N. Then a change to runlevel N+1 is initiated. What happens then is that X is woken up (still being in runlevel N) and terminated shortly afterwards, upon entering runlevel N+1. To avoid this, configuration must be reloaded after runlevel changes. * src/ctl.c (res_runlevel): Don't initiate ACTION_RELOAD after setting the runlevel. * src/pies.c (main): Begin main event loop with call to pies_pause. * src/pies.h (pies_set_hook): New proto. (inittrans): Remove proto. * src/socket.c (pies_set_hook): New function. (pies_pause): Call pies_pause_hook if defined. * src/sysvinit.c (inittrans): Change to static. If transition was initiated by user (e.g. by invoking telinit), schedule ACTION_RELOAD. (sysvinit_begin): Set inittrans as pies_hook
Diffstat (limited to 'src/ctl.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ctl.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 731b31b..aca1d18 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -2149,7 +2149,6 @@ res_runlevel (struct ctlio *io, enum http_method meth,
if (strlen (val->v.s) == 1
&& sysvinit_set_runlevel (val->v.s[0]) == 0)
{
- pies_schedule_action (ACTION_RELOAD);
json_object_set_string (io->output.reply, "status", "OK");
}
else

Return to:

Send suggestions and report system problems to the System administrator.