Command Edit <CONF> opens file /etc/finit.d/available/<CONF>.conf in
the editor referenced by Linux environment variable $EDITOR
If $EDITOR is not set it will try to open emacs and if emacs is not
found it will try to open the file in vim.
Signed-off-by: Andreas Egeberg <andreas.egeberg@gmail.com>
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>
On systems with udevd, or systemd-udevd, we must wait for udevd to start
before calling udevadm. This patch updates service and runtask stanzas
to the new condition system naming and adds 'log' to the udevadm cmds.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The refactor in 13893b9 caused a regression in composing service
arguments. This patch should rectify that.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Simplify log redirection, probe for logit early and fall back to
use a while-loop of syslog() instead.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
By not putting logit in the same process group as the service whose
output is consumed by logit, we can send signals to the service,
and it's group, without affecting logit. This means that logit will
continue to log away until it's stdin is closed, which will happen
when the service is reaped.
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
Delay duplication of stdout/stderr until after forking a logit
process, otherwise we'd have a ligering reference to stdout/stderr.
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
The tzset() function sets the global variables 'daylight', 'timezone' and 'tzname'
according to the value of the TZ environment variable, or to the value of the
_CS_TIMEZONE configuration string if TZ isn't set, or to UTC0 if neither is set.
Signed-off-by: Andreas Egeberg <andreas.egeberg@gmail.com>
Modeled after systemd.show_status, currently without the 'auto' setting.
- finit.debug[=bool]
- finit.show_status[=bool]
- finit.status_style[=old,classic,new,modern]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch reverts back to the progress/status behavior of Finit < v3.0
because this is what most users expect, including the maintainer. The
resulting code and configure script is a lot simpler to understand and
maintain:
- No more --enable-progress or --enable-progress-classic configure
flags. Instead a progress_style variable in helpers.c that can
be changed at compile time for those that really need it.
- No more 'splash' kernel commnand line option. This turned out to
be *very* confusing to many users who believed it was some sort of
graphical splash screen à la Plymouth.
Also, when Finit debug is enabled we now have a global 'debug' flag
which now alo controls if klogctl() should be called to prevent the
kernel logs to the console or not.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Default to power-off the system, even for shutdown command
- Fix -h switch for SysV init shutdown command compatibility
- Add -P switch for systemd shutdown command compatibility
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This reverts commit 8a71f2d323 because
if no other application has a working utmp then there's no poit for
Finit to have one. Instead we'll be disabling all utmp support when
running on a musl based system.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Instead of just walking /run/finit/cond, also show the source of each
condition. The hook and net conditions are hard-coded to init[1] atm.
and unknown conditions are shown as unknown[0].
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In the v4 bump we removed tar.xz archives in favor of bringing back
tar.gz. This was a bit premature and could easily cause unnecessary
headaches downstream.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>