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 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>
Printing the progress of run-parts script just like for `rc.local`
seems reasonable. Also log a warning if any script exits abnormally.
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
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>
Slight reshuffle of columns so status and condition listings are more
similar. Also, calculate and adjust necessary column widths.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the recent change in the condition handling we've decided to put
the (name,id) tuple in focus for everything Finit.
This patch changes from job:id in the status listing to name:id instead.
In verbose mode we change to show the job:id and the command + args.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
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>
Change service conditions from the non-obvious <svc/path/to/foo> to
<pid/foo:id>, utilizing the unique name of the service instead of the
weird composition of paths from /run and PID file names. Hopefully
making it more clear that one service's pidfile is another service's
`<pid/foo>` condition.
Note: this is an incompatible change to the condition system!
The Finit major version will be stepped to indicate this.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
From, e.g.,
Starting foo:, PID: 123
to
Starting foo[123]
or, when an ID has been given
Starting foo:id[123]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We have our own subdirectory alread in /run, for conditions, and the FHS
recommends services maintain their own subdirectory if they have >1 file
for runtime storage.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>