The new libite uses autotools to build, and since we use it as a GIT
submodule we have to call its autogen.sh before we call the configure
script, from within the Finit configure script. We may have to move
to use autotools even for Finit ...
Also, make sure to only call clean/distclean on libite if the local
version is selected at configure time.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When a service's condition transitions to `flux`, put it in the
waiting state, even if it does not support SIGHUP. That way, if the
condition returns to `on` we can simply SIGCONT it. If it goes to
`off` it will still be stop/started as before.
When reloading dynamic services, inetd services deleted marker was not
being cleaned. This caused finit to stop and start all inetd services
at every other reload.
This patch introduces a new service type called SVC_TYPE_INETD_CONN,
which represents a running inetd connection. These are handled in much
the same way as tasks. I.e. they are considered one-time jobs, with
the difference that they are removed upon completion.
When cleaning up removed services, the assumption was made that if a
service was not 'removed', it was 'clean'. In reality, it could also
be 'updated', which was then overwritten, causing services not being
restarted. Don't do that.
As a future precaution, make the dirty field const, only allowing
updates from accessor methods.
During documentation of the state machine, some theoretical problems
where discovered that could have lead finit to spawn a new instance of
a daemon before the previous one had been collected.
Now a service will always go through the STOPPING state when leaving
RUNNING. This ensures that the PID has been collected before any calls
to service_start.
...documenting your work is, apparently, not a bad idea. :)
Old event system has been replaced with a more generic condition
concept. The idea is that finit plugins may provide arbitrary
conditions that services may specify as dependencies that they require
to run.
In order to accomodate this, the service management has been
redesigned to use a state machine.
Parser would erroneously interpret an event specification containing
slashes as an inet service/proto specification.
E.g. "<net/gw>" was interpreted as port "<net" using protocol "gw>".
Stopped services are now (again) listed as "stopped" and halted
services, due to a runlevel change, are listed as "halted". Several
users complained that this change was just not intuitive. I agreee.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
By popular request, this patch adds support for querying status of a
single service. The syntax is similar to that of stop/start/reload.
Both `initctl show ...` and `initctl status ...` is supported.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When no services were stopped we must ensure to start/SIGHUP any new or
SIGHUP:able services as the last pass of the `initctl reload` cycle.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch fixes a hang when performing a system reconfiguration using
`initctl reload`, `SIGHUP` or running `(f)init q`, which caused Finit
to wait for SIGHUP:able services to stop.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch reenables verbose mode at shutdown/reboot, if it was disabled
at boot. This allows the user to see the output from the `urandom.so`
and `hwclock.so` plugins at reboot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The urandom.so plugin uncovered that `print_desc()` does not honor the
`verbose` flag. At runtime `print_desc()` et al should no be displaying
anyting when we finit operates in terse mode.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Leverage new svc_t states in initctl status/show output. Also, ensure
different svc_t types have correct start state.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
new postponed stop handling tried to reload already stopped and removed
services. We should of course skip already stopped services and halt
those that have been removed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch reverts the change in behavior introduced in Finit v2.2,
commit 924bf041, where `initctl restart JOB` changed from 'stop + start'
to `SIGHUP` for services that support `SIGHUP`.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When `service_stop_done()` is called with a `NULL` argument and no
dynamic services have been stopped, this regression is triggered.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch makes it possible to see debug traces when running the client
program initctl, using `--debug`. Please note, this does not affect the
debug command to the daemon.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>