Since Finit v4.0 kernel console output has been silenced just prior to
the banner being printed, unless finit.debug mode was enabled. This
patch makes sure to check the kernel loglevel, if it's >= 7, finit no
longer disables kernel console ouput.
Consequently, you now need 'quiet' on your kernel command line, or a
loglevel < 7 for a quiet boot, at least until a syslogd takes over.
This means that you now can debug the kernel and finit independently,
which should be a great comfort to anyone doing bringup or any form of
kernel debugging.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch switches from "cp /var/lib/misc/random-seed /dev/urandom"
to use the kernel RNDADDENTROPY ioctl, which actually increments the
entropy count.
Also, the amount of random data saved at reboot is increased from the
fairly low 512 to 32768 bytes.
All in all, this should greatly improve the stability of most systems
during, or close to, bootstrap. In particular embedded systems with
limited or no HWRNG.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since we just want to clear the complete line, and are already a the
beginning of the line, we can use the simpler \e[K which also seems
to fix the display resize bug in #210.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Due to an unfortunate name clash with the DirectFB project LiTE, the
libite (-lite) project had to change its header namespace from
lite/*.h -> libite/*.h
This patch adds support for the new namepace in Finit, triggered by the
define _LIBITE_LITE, from the .pc file read by pkg-config. This should
only be needed on systems that install libite without the compatibility
symlink lite -> libite/ in the staging include directory.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
It would be good if we can control the services more specifically with
the following parameters like:
restart:N - how many times shall the service to be restarted on
failures (<10), the default max is 10.
restart_tmo - the timeout of the restarting.
norestart - dont restart on failures.
oncrash - once all retrying also fail, how to deal with it,
rebooting or ignoring the failures.
Signed-off-by: Robert Andersson <robert.m.andersson@atlascopco.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Both DBUS user and pidfile is configurable in DBUS compilation, by
passing "--with-dbus-user=" and "--with-system-pid-file=", let's avoid
hard-coding them here, use macros instead.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
It's configurable in /etc/login.defs as NOLOGINS_FILE, avoid to hard
coding it here, introduce a macro FINIT_NOLOGIN_PATH instead which is
configurable from compiler flags, it's not defined, then back to
_PATH_NOLOGIN from /usr/include/paths.h.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
fastboot: once enabled, fsck would be skipped on filesystems listed in
/etc/fstab.
fsckfix: once enabled, 'fsck -ys' would be run instead of 'fsck -a',
and check the return value larger than 1 as a failure and goes
to login console.
They are both disabled by default, no functional changes unless an end
user choose to enable them.
The idea derives from Sysvinit's "FASTBOOT" and "FSCKFIX".
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
The iterator function getmntent() is not stable. It may skip
entries if the contents of the iterated file changes, which
is the case with /proc/mounts when filesystems are unmounted.
As a result, some filesystems were never unmounted.
To fix this, iteratation is now restarted after every
sucessful unmount.
Signed-off-by: Robert Andersson <robert.m.andersson@atlascopco.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
"protected" is a C++ key word, replace it with "is_protected" avoid
compiling failures with C++ compiler.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
There are small typos in:
- doc/conditions.md
- src/mount.c
- src/svc.h
Fixes:
- Should read `satisfied` rather than `satsifed`.
- Should read `process` rather than `prorcess`.
- Should read `measure` rather than `meausre`.
We've had several logit() messages of LOG_INFO level that never
really made it to syslog because we classified it as "debug".
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>