This patch (untested) patch calls `service_reload_dynamic()` after both
run-parts (if directory exists) and after `/etc/rc.local` has run. The
intention is to reload any services modified/added/removed by a user
script so the system is properly up to date.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch allows all services to go from READY -> RUNNING, this to
prevent started inetd connections from being treated as "stubborn"
and inadvertently killing them off after a few seconds.
The same actually applies to run/task applications.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch fixes issue #51 by reverting b4b63d3, which is not needed
anymore since service callbacks have been removed from Finit3.
The `sig_unblock()` function, called for each forked off child, should
now be balanced with caught signals.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We can safely skip tmpfs, nothing to clean from previous boot there.
In fact, if we clean it we may spoil things for udev, which saves
pre-boot files in /run/udev.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch removes the long standing Watchdog daemon from the TODO list.
We now have a bare-bones watchdog service built-in to Finit, with
support for handing over to an external, and possibly more advanced,
using the initctl API.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds a simple but effective watchdog daemon with support for
handover to an external daemon, should one register using the API.
Disabled by default, enable by:
configure --enable-watchdog
The watchdog forks to the background, opening /dev/watchdog setting a
three second timeout, and kicking every second. At shutdown/reboot the
daemon will receive SIGPWR from Finit to exit and cause a WDT reboot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
To prevent returning the prompt too soon, and thereby messing up the
output from Finit, wait a bit after successful delivery of signal to
reboot/halt/poweroff.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds initial support for registering a watchdog daemon with
Finit. Needed for situations when you want the system to actually be
rebooted by the watchdog timer (WDT) circuitry rather than the kernel.
The initctl API has been extended with a INIT_CMD_WDOG_HELLO command
that is used to both register and "ping" Finit periodically. As long as
Finit responds (with an ACK) the watchdog daemon knows Finit is alive.
At shutdown Finit stops all services (except kernel threads and daemons
marked with @ in the first character of their process name) and, if a
watchdog has registered, SIGPWR is sent to it when Finit has finished
unmounting etc., just prior to kernel reboot/halt/poweroff.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Now that we change runlevel at shutdown/reboot, we also need to restore
terse mode before calling the shutdown hooks, like before.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch replaces kill(-1, signo) with a more fine grained
do_kill(signo) that traverses each /proc/PID, skipping kernel
threads and special [0][0] == '@' processes.
The reason for this patch is not only future compliance with
freedesktop.org standards, but also a way of not killing any
critical processes at shutdown, e.g. mdadm or watchdogd.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The shutdown hook is supposed to run right before services start
receiving SIGTERM. Change due to previous refactor.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch moves both the definition and the call to bootclean() from
finit.c to the bootmisc plugin. We want to call bootclean() *after*
any /run and /var file systems have been mounted.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>