Per service rlimit is new in v3.1. When an inetd service connection is
created we do a selective copy from the parent inetd. We also need to
copy the parent's rlimits, otherwise the child will be killed as soon
as the kernel starts it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch increases the default wait, 2 --> 5 sec, while pending for
Finit + watchdogd controlled reboot/shutdown. We don't want to hand
back the prompt when we're not really ready yet.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch builds on top of the recently introduced "silent by default"
and support for kernel cmdline `splash` to disable silent operation.
At shutdown/reboot `log_exit()` is called, the intention is to re-enable
progress output so the user can see what's going on. So, we need to re-
set `silent` to the same setting as log_init() started with, hence the
new `muffler()`.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Automatic redirection of output was introduced in v3.0 and for the
upcoming v3.1 a configure option was added to disable it.
By popular demand this patch flips the default. One now has to
explicitly enable this feature to get redirection.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for restarting the API socket on SIGHUP, similar
to how SysV init and systemd use SIGUSR1 to restart their FIFO or D-Bus.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
An interface may come up with IFF_RUNNING already set, but we would
only detect IFF_UP. This patch simplfies the code a lot by pivoting
the qualifier from using ifi_change to ifi_flags, which is the actual
current status of an interface.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This is a quite intrusive change. In addition to the already reserved
runlevels 0 and 6, halt and reboot, respectively, this patch reserves
runlevel 1 as *no networking*, like the traditional SysV init did. One
of the reasons for this change is the new 'single' user mode, introduced
earlier. Most users when entering 'S' or 'single' on the kernel cmdline
expect the single user mode (runlevel 1) to be without networking.
This leaves 2, 3, 4, 5, and 7, 8, 9 as fully user-configurable runlevels
with networking.
Of course, networking can still be enabled in runlevel 1 using ifconfig
or ifupdown, or change runlevel.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
If hostname is missing from /lib/finit/rescue.conf the system will
default to the configured default hostname (noname).
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds a rescue (revovery) mode to Finit. Simply add `rescue`
to the kernel cmdline at boot and the following steps at bootstrap will
be skipped:
- Load of services/run/task/etc in /etc/finit.conf + /etc/finit.d/*.conf
- fsck of filesystems in /etc/fstab
- Remount of / to read-write
- Mount of all filesystems in /etc/fstab
- swapon
- A few plugin hooks:
- HOOK_ROOTFS_UP
- HOOK_MOUNT_ERROR
- HOOK_BASEFS_UP
- `runparts DIR`
- /etc/rc.local
Instead of loading /etc/finit.conf and /etc/finit.d/*.conf Finit loads
the file /lib/finit/rescue.conf, which can be overridden by the operator
if needed. If this file is removed (or lost), Finit falls back to start
a simple root shell, without any login.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The /lib/finit/plugins path is as of this patch not longer possible to
change. Use --prefix or --libdir instead to change the leading path.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Finit v3.1 adds support for reloading /etc/finit.conf, document what
actually is read at runtime, compared to at bootstrap, and clarify
which stanzas are for what part of the boot process.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The difference between `runparts DIR` and `/etc/rc.local` is that one
should run just before the first runlevel change (to the configured
runlevel) at the end of bootstrap, whereas the other should run just
before launcing the TTYs, i.e. after all tasks in the configured
runlevel have been started.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>