Minor coding style cleanup, code simplification, and change service
'crashing' status text to 'crashed' to fit column width.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Simple wrappers for the signals Finit responds to. Will need complete
rewrite when support for delayed reboot/halt is added.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The condition flux state does not work like that, so keeping
this sub-command is only confusing to the user.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
These scripts help a user to configure, build, and install Finit
correctly on a Debian 8 (Jessie) server install.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The fs.fs_type is only for *BSD, we hard-code it to "rw"
in the meantime. Should be safe in most cases.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The debug mode cannot be used in run_interactive() that early, so we
must disable it during the complete fsck run.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for the following /etc/fstab API's on systems
that do not have them, e.g. musl libc on Alpine Linux.
- setfsent()
- getfsent(), and
- endfsent()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Run fsck much earlier, as soon as we can in fact.
The first 13 characters of the UUID, label or device name should
be sufficient to identify the device, without violating max width
of 78 chars.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for running fsck on all file systems listed in
/etc/fstab with a passno > 0. The fsck runs sequentially, starting with
the root fs (passno 1).
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Disabled until we decide on config to disable/enable. It is quite
annoying to not be able to see the boot messages with it on ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Plugins without declared name registered with full path + ext
=> Strip path and extension
- Plugins registered with __NAME__ => strip extension
- Do *not* call dlclose() from destructor, must be called by Finit
Also, some minor cleanup and code simplifcation.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Fix compat INIT_CMD_ defines so Finit clients can talk to SysV init
- Add setenv support, only for INIT_HALT={POWERDOWN,HALT} to runlevel 6
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adopts the BusyBox init signals for handling halt, reboot,
and poweroff. The SIGINT and SIGPWR signals still behave the same as
before, even though they likely will become configurable in a future
release.
Note: the disabling of Ctrl-Alt-Delete (SIGINT) is also removed!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
That's maybe a bit unfair. This patch implements a brief version of
what is really needed to safely unmount all file systems on a modern
Linux distribution. Yes, it's this insane. (Who am I kidding, it's
worse! Just have a look at the ancient scrolls hidden in your /etc!)
Here is where we use the new plugin_exit() and api_exit() API's from an
earlier patch. Making sure to exit and close any kernel descriptors.
Then follows a bizarre spell cast on leaking descriptors, rebooting in
a child, remounting / as read-only, and a whole slew of other R rated
stuff to prevent mount/umount from returning 32 ...
Stay safe people, use protection always!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
FIFOs, PID files, and other non-devices belong in /var/run (or /run
these days), not /dev -- as per FHS. Compat with Debian SysV init.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The TTY handling in Finit has always been a bit of a patch work. This
commit is an attempt at a first cleanup and simplification.
Included is a brand new built-in getty which should work fine on both
virtual and serial consoles. It is however completely untested on the
latter serial consoles.
Still TODO: add support for /etc/securetty, add support for actually
setting TERM when calling /bin/login.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Embedded Linux systems usually employ BusyBox mdev. This patch assumes
that all non-embedded systems employ udev. Adding support for cleaning
up the udev db after the initramfs, or mounting /dev if that not done.
It also runs the udev-finish script at the end.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Look for 'auto' *and* 'allow-hotplug' in /etc/network/interfaces when
bringing up Debian/BusyBox interfaces at boot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
If the user specifies no 'tty /dev/ttyN' in finit.conf this code
took upon itself to add a backdoor to the system. Let's remove
it and rely on the operator deciding what is best practise.
With this patch no getty, or fallback shell, will be started if
no tty line in finit.conf is available.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>