This patch drops the stand-alone reboot binary and folds it into the
initctl tool, which now becomes a multi-call binary.
With this change the reboot/shutdown/poweroff/halt/suspend commands also
no longer default to sending signals to PID 1, instead it now uses the
initctl <--> finit UNIX domain socket API. Signals are only used as a
fallback in case of non-working domain socket. The -f,--force mode of
operation still works, where `reboot(2)` is called directly.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The SysV API compatibility layer gives too little value to be worth
the effort of maintaining it. Users are encouraged to use the
`initctl` tool instead.
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This patch removes the built-in inetd support from Finit. We recommend
using an external inetd instead, e.g. xinetd.
If you liked the feature set our inetd provided; filtering per interface
and port redirection, then please let us know or use the code in this
patch (MIT licensed) to recreate it. We are open to reintroducing it,
but then as a stand-alone daemon like the bundled watchdogd and getty.
So long for now, old friend.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since sysklogd now ships an excellent enhanced logger tool there is no
need for Finit to provide its own tool for the same purpose by default.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Similar to how systemd creates cgroups for all services, for purposes of
tracking, Finit now does the same. We also mount all available cgroups
in the /sys/fs/cgroup namespace.
This patch adds support for grouping processes in logical cgroups, like
systemd, and an `initctl ps` command to list the hieararchy.
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>
This change is one of the required intermediate steps to remove the
shared memory store for all svc_t, this in turn to avoid any external
programs manipulating the internal memory of PID 1.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We need the name client.c for the client side of api.c, so let's rename
the client to its traditional name.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch moves the stty() function from getty.c to a separate file so
it can be called from exec.c as well. The fix to #84 is simply to call
stty() in prepare_tty(), which is shared by run_getty() and run_getty2()
and called before "Please press Enter ...".
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for enabling and disabling services in
/etc/finit.d/ by adding another subdirectory:
/etc/finit.d/available
Enabled service/run/task stanzas are by convention symlinked
to the parent dir. The initctl tool has three new convenience
commands to facilitate operating with this:
initctl list
initctl enable <CONF>
initctl disable <CONF>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>