Still TODO, replace `run_interactive()` start of dbus-daemon with a
proper service. Possibly only service_register() is needed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch fixes the ordering of UTMP events. The first event that is
expected in /var/run/utmp is reboot, next is the runlevel change to
the configured runlevel, e.g. from S --> 2.
Let the bootmisc plugin handle this, it knows when /var/run/utmp has
been created and is writable. It is not the eact boot time, but close
enough for most usees.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for initializing /var/run/utmp with the initial
reboot as well as a shutdown record in the UTMP db.
Also, the run level change now properly records ~ and ~~ as line and id,
respectively, and the kernel release and time of each UTMP record is now
set properly.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
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>