Commit Graph
100 Commits
Author SHA1 Message Date
Joachim Wiberg 8904ca993e test: reindent
Standard Emacs shell-mode 4-space indent.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-18 06:38:59 +02:00
Joachim Wiberg efed0db16b test: reindent, don't warn on PID 0
PID 0 for a collected task is not a bug, 1 or < 0 is a bug.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-16 10:28:48 +02:00
Joachim Wiberg 11946f12d3 contrib: disable bundled watchdog for Alpine builds
In the Alpine reference builds we use 'watchdog' from the BusyBox suite.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-16 10:28:48 +02:00
Joachim Wiberg 2ba359ed80 Merge pull request #365 from markand/man-typo 2023-09-15 12:31:14 +02:00
Joachim Wiberg 1ee6c9f46b watchdogd: drop startup message, leaks to console
We use LOG_CONS to ensure log messages reach the operator, but since
watchdogd starts very early this means non-critical messages like the
initial greeting leaks to console because syslogd has not yet started.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-15 09:47:42 +02:00
Joachim Wiberg a88eb82a68 Simplify overly complex description, drop links to older versions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 10:03:49 +02:00
Joachim Wiberg a436a1c8cb .github: speed up release job, and support for setting pre-release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:40:55 +02:00
Joachim Wiberg 7cb91854b0 Update ChangeLog and bump version for v4.5-rc2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:22:11 +02:00
Joachim Wiberg 939ae02a6a Increase MAX command, and arg., length: 64 -> 256
With non-standard paths, e.g., when running `make distcheck`, the
absolute path to some commands become ridiculously long.  However,
this has been a recurring issue for some users in the past, so it
is time to increase the capabilibieies of Finit to cover this.

Yes, a better way is probably to allocate all these strings when they
are used, but that would require a redesign of the initctl API and
likely cause a lot of regressions before everything has stabilized.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:15:55 +02:00
Joachim Wiberg 480d29175c test: minor, clarify
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:15:40 +02:00
Joachim Wiberg ea68413512 test: add missing scripts to dist for new runparts test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:15:17 +02:00
Joachim Wiberg 4edfa9859e .github: fix variable sharing between jobs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:14:28 +02:00
Joachim Wiberg eb6291c943 Update ChangeLog and bump version for v4.5-rc1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 13:26:33 +02:00
Joachim Wiberg 756b7c3fb6 Document advanced hooks/plugins to trigger rescue.conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 13:03:20 +02:00
Joachim Wiberg 263aec292a Support for disabling invocation of rescue mode from kernel cmdline
The rescue mode that can be invoked from the kernel command line is
potentially unsafe.  Many systems lock the root user account, or use
another account for managing, e.g. 'admin'.  The sulogin program(s)
would on such systems give the user a root prompt.

In #357 we added support for setting a custom sulogin user, but for some
systems that is not enough.  On many embedded systems the /etc/passwd
and shadow files are populated at bootstrap and at the time rescue mode
runs, these files will be unpopulated.

The only, truly safe, approach on such systems is to disable rescue mode
completely.  Otherwise intricate Finit plugins have to be used that run
before rescue mode is started -- increasing the complexity of the system
as a whole.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 12:45:03 +02:00
Joachim Wiberg 5a946a4ea7 doc: clarify what single user mode does
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 12:44:33 +02:00
Joachim Wiberg c90b4d797b doc: clarify eval order of sulogins in traditional rescue mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 12:44:00 +02:00
Joachim Wiberg 6e7a2fb6d5 Fix #357: allow sulogin with user different from 'root'
In issue #357 there's a proposal for optionally allowing /bin/login, but
after intense discussions we've agreed that would be opening up for all
sorts of potential (security) issues.

it's better to keep things as-is but with the added twist of supporting
a custom user at configure time, e.g., 'admin'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 11:37:15 +02:00
Joachim Wiberg ddedcf77e8 Follow-up to 4701ede: reschedule bootstrap check while not done
Non-trivial systems, like Infix[1], require more than one lap around the
track to warm up.  This is a follow-up to issue #362, commit 4701ede, in
fixing an obvious oversight in the new sm_check_bootstrap() work.  While
there are still outstanding bootstrap tasks or services that have not
yet started, we must reschedule the worker.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-13 09:35:02 +02:00
Joachim Wiberg 924ec2ef80 test: add missing runlevel/ref.log
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 21:18:28 +02:00
Joachim Wiberg a49f27c191 initctl: show runlevel 'N S' instead of 'N 10' during bootstrap
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 14:05:11 +02:00
Joachim Wiberg b41b4ce989 test: new, verify runparts order
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 14:04:26 +02:00
Joachim Wiberg 3d74e93fa2 test: when rc.local is busy, delay test until it's free
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 14:03:43 +02:00
Joachim Wiberg 443700a88e test: new, verify that a run task can call initctl
Follow-up to #362

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:30:57 +02:00
Joachim Wiberg 4701edef4c Fix #362: prevent blocking main loop when starting run tasks
Drop complete() logic, waiting for run tasks to finish, from the
service_start() funciton to the general service_monitor().  This
refactor frees up the main loop and allows us to answer any API
calls from initctl even from the run task itself.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg e6da0a22e7 Helper script for development/test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg 7be2bbbc30 doc: add SysV Init Compatibility section
Minor updates and fixes to other sections as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg 3e269c632f Start runparts with -d in debug mode, otherwise -p for progress
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg f2507d9fd7 runparts: fix arg handling and skip backup files
For some specialized forms of runparts, e.g., start-stop scripts in SysV
init replacements, there is a need to append an argument.  Typically
this is 'start' or 'stop'.

This functionality has been broken for quite some time, meaning we
should consider it being unused by current users of Finit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg e9f403bceb runparts: simplify and adjust log levels
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg c03176c42a doc: relocate text to common TODO file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg 9707bfb103 TODO: things to fix before release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg 11430f83c8 Use unbuffered stderr for runparts logging result and progress
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg a22a794f55 Clarify usage text slightly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg 5556501287 dbg(): add missing \n for stderr logginge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg ab554568b2 test: handle very short tests that exit before reaching runlevel 2
Bootstrap-only tests that just verify basic functionality are often very
short.  This change handles that by retrying SIGUSR2 until Finit has had
the chance to finalize bootstrap and enable signals.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg b39a4498a3 test: enable bootstrap-crash, regression test for #351
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 13:16:09 +02:00
Joachim Wiberg dead2444e2 doc: 'run' command limitation, blocks Finit completely
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-30 10:21:07 +02:00
Joachim Wiberg a58002588e Refactor initial startup, run runparts and rc.local in background
The code refactored in this commit has long been an eyesore.  The
hand-over, from the sequential main() function, to the event loop
was clumsy at best and was very difficult to debug.

Instead of using a series of workers we now delegate everything to
the big state machine by introducing a new SM_BOOTSRTAP_WAIT_STATE.

Both the runparts and rc.local scripts now run in the background, no
longer blocking the event loop from responding to initctl calls.  To
ensure they run at the same point in time two things have been done:

 1. A new <int/bootstrap> condition has been added which triggers
    runparts, which now is a regular task created by conf_init()
 2. /etc/rc.local is started from SM_RUNLEVEL_WAIT_STATE when we
    transition from runlevel S to any other runlevel.

Fixes #356

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-30 10:09:34 +02:00
Joachim Wiberg 28e101aaae Minor, ensure we can call exec_runtask() with NULL args
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-29 23:22:07 +02:00
Joachim Wiberg 6da8af8136 Minor, add debug logs and clarify comment
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-29 23:21:27 +02:00
Joachim Wiberg 3069e753e1 getty: add missing '-p' in usage text
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-27 13:34:45 +02:00
Joachim Wiberg aafd5c1010 Allow overriding SCREEN_WIDTH
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-27 13:33:57 +02:00
Joachim Wiberg 2f51c8ea0d test: minor, log() -> inf()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-27 13:33:22 +02:00
Joachim Wiberg d1130473fc Follow-up to 1fc0f36, missing %s argument
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-27 13:33:00 +02:00
Joachim Wiberg b682a5e4fe Fix #360: Bash completion for initctl
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-17 07:31:59 +02:00
Joachim Wiberg 1fc0f36c6c initctl: check [enable | disable] for absolute path, not supported
For reference, see issue #359.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-11 08:06:46 +02:00
Joachim Wiberg 5df5b22327 man: update finit.conf(5) with info on enabled and available
This should clarify the messup on the behalf of the mainatiner in not
documenting this properly, including the deviations introduced in v4.4

See issue #359 for a background.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-11 07:57:57 +02:00
Joachim Wiberg 4153c7966d Fix #358: fix modify events for /etc/finit.conf
- iwatch events return filenames in dir field, ignore file for those
 - improve warning message on failure
 - drop bogus "Out of memory" error log message

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 14:20:36 +02:00
Joachim Wiberg 458d68533f Update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 13:37:25 +02:00
Joachim Wiberg 63b5db38df Refactor, ensure pre:/post:/ready: scripts run in the same cgroup
Related to issue #361.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 13:25:11 +02:00
Joachim Wiberg 2135639508 Update changelog with latest fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 10:27:29 +02:00
Joachim Wiberg 9c8cd6c024 Improved logging on failure to execvp() in forked child
The execvp() call always fails with -1, so only logging exit code when
collecting the PID is not enough.  When debugging the user needs to see
the errno from execvp(), e.g., "No such file or directory", when the
command was missing the absolute path to the executable.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 10:23:20 +02:00
Joachim Wiberg 450f498061 Fix #361: cgroup move fail if starting service as non-root
Regression in v4.4

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-10 10:23:20 +02:00
Joachim Wiberg 5769500afe Bump devel version and update ChangeLog for v4.5 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-27 12:33:16 +02:00
Joachim Wiberg dc61969164 Check in service_stop() if the process is already dead
Related to 6f0d448 in that we check if the kernel knows about this
process before we try to stop it.  If it's already dead we clean up
and return.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-27 12:22:59 +02:00
Joachim Wiberg 6f0d448765 Fix #227: delayed service_kill() may stall shutdown/reboot
This turns out to be the root-cause of #227.  Finit is waiting forever
for proceeses to stop at shutdown/reboot, while a subreaper has already
collected the PID, or Finit for some reason did not collect the PID.

When the process timeout calls service_kill() we now check if the kernel
actually knows of this process or not.  If it's already been collected,
we can notify Finit of this by calling service_monitor() to clean up the
'svc' and in turn call sm_step() to finalize the state transition.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-27 12:18:09 +02:00
Joachim Wiberg 0c9b7a67e0 doc/plugins.md: fix script hook path
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-27 12:14:26 +02:00
Joachim Wiberg 5db2fb2c32 initctl: let -f force-skip check for built-in service
When calling `initctl -b create` from a start script at bootstrap you
risk blocking the boot since Finit currently cannot reply to IPC during
that period.

This patch allows -f to override this builtin check for the following
initctl commands:

 - touch
 - show
 - edit
 - create
 - delete

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-20 10:25:02 +02:00
Joachim Wiberg f4d3ec1a9f Update ChangeLog and bump version for v4.4 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:40:56 +02:00
Joachim Wiberg 51befb492c Allow conflicting services to start when conflict is resolved
These changes add a new svc_block_t type: SVC_BLOCK_CONFLICT so a user
can more clearly see why a run/task/service has not been started by
Finit.  The reason for the block is by default logged, which can be
escaped by using the `nowarn` flag.

Also, when the conflict is resolved, allow the service to start.

With these changes, the system/hotplug.conf should work better and
cause less questions about "strange" log messages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:23:40 +02:00
Joachim Wiberg 7850378e15 Fix issue with messed up linewrap in qemu-system-x86_64
Apparently the qemu-system-x86_64 in -nographics mode does all sorts of
crazy things to the terminal.  Most annoying, it disables linewrap.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:05:59 +02:00
Joachim Wiberg 438d6b4e63 Document fix of regression from Finit v3.2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-14 09:33:10 +02:00
Joachim Wiberg 712f68f9da Fix #355: regression stopping a process and its group
In 91a9c83 a regression was introduced that affects the way Finit stops
a supervised process and its process group.

Instead of sending SIGTERM to the process, delegating the responsibility
to that process to inform any children it may have, Finit as of 91a9c83
sends SIGTERM to the entire process group.  For SIGKILL this is fine,
SIGKILL only runs as cleanup and as a last ditch effort if the process
doesn't respond to SIGTERM.

This regression, introduced in v3.2, directly affects services like
avahi-autoipd that have forked off children that it needs to tell to
exit cleanly before it returns. With the patch in question these
children are never allowed to complete, which in turn causes lingering
169.254 link-local addresses on interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-14 09:27:09 +02:00
Joachim Wiberg 8a32ec5c92 Bump version for v4.4-rc2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-08 09:58:42 +02:00
Joachim Wiberg 081622a085 Enable more features at distcheck for improved coverage
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-08 09:56:25 +02:00
Joachim Wiberg 2526431d8e Allow Finit to inherit PATH and SHELL from env.
When started as a monitor in a container, or for the test suite run from
distcheck, we must allow Finit to find its own tools like initctl.  This
should also be a more generic solution that cover more cases.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-08 09:52:59 +02:00
Joachim Wiberg 47d8a83668 Drop hard coded path limit in glob of *.conf files
A simple distcheck revealed that the local path[] was too small to store
something like /home/jocke/src/finit/finit-4.4-rc1/usr/lib/finit/system/

This refactor should cover all cases.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-08 09:52:21 +02:00
Joachim Wiberg f72f3febf9 Follow-up to e00fda5, allow runlevel 0 for kevent and watchdogd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-08 09:49:06 +02:00
Joachim Wiberg 138546d008 .github: debug failing tests in release build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 21:06:17 +02:00
Joachim Wiberg cee244d151 Drop TODO, sysv works as well as they can right now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 20:55:00 +02:00
Joachim Wiberg 7af4ad5c24 .github: Release General needs a new uniform!
We've prepared this at one of the finest tailors at Saville Row.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 20:53:25 +02:00
Joachim Wiberg c0d3705ed5 Bump version for v4.4-rc1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 20:45:03 +02:00
Joachim Wiberg 5cf2b9a283 Massive update of ChangeLog, add missing early changes after v4.3
Finit v4.3 is now almost a year old ... time to get v4.4 out the door!

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 20:42:20 +02:00
Joachim Wiberg 0e898da6e5 doc: minor, whitespace
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 20:42:11 +02:00
Joachim Wiberg d9f13a1e50 Notable breaking change in runlevels
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-07 11:53:22 +02:00
Joachim Wiberg 4fbcd1bbad Update copyright years
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 06:00:34 +02:00
Joachim Wiberg b6c5498f43 initctl: refactor serv_enable() for readability and coding style
Also apply the same logic to serv_disable() to drop 40 char limit on
service names.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 05:40:26 +02:00
Joachim Wiberg 9a6c68c952 initctl: follow-up to 700c32fd, fix enable regression
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 04:32:09 +02:00
Joachim Wiberg e8170e1216 doc: add use-case for runparts scripts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-04 10:05:40 +02:00
Joachim Wiberg 059a4c8a86 man: document new kernel cmdline options
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-02 00:22:50 +02:00
Joachim Wiberg 0de9db68a3 system: don't warn if neither udev/udevadm or mdev is available
The user may have their own setup of things, by default we should not
cause unnecessary warnings in syslog.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-01 23:53:40 +02:00
Joachim Wiberg aeff68b598 test/rclocal.sh: new test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-01 23:50:57 +02:00
Joachim Wiberg 700c32fd73 Initial support for templating and instantiating services
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-24 20:14:30 +02:00
Joachim Wiberg 334d4a708a Follow-up to e00fda5: skip bootstrap-only services when not in bootstrap
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-24 16:28:49 +02:00
Joachim Wiberg 4d472273e1 .github: debug weekly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-23 16:47:47 +02:00
Joachim Wiberg 13f1359b3a .github: fix and simplify weekly distcheck job
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:46:06 +02:00
Joachim Wiberg 2e5b97c8b2 plugins: check explicitly for (time_t)-1 from mktime()
Found by Coverity Scan.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:30:29 +02:00
Joachim Wiberg 9a962c86c8 Update docs a bit about runlevel 1.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:11:27 +02:00
Joachim Wiberg f954a4cb92 service_stop: add missing && do_progress for print_result()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:11:27 +02:00
Joachim Wiberg feb97bc77c Minor, helper function for logging runlevel as a char
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:11:27 +02:00
Joachim Wiberg e00fda5dc3 Fix #352: separate runlevel S from runlevel 0
Due to an old design decision runlevel S was encoded internally as '0',
meaning it was the same as halt/poweroff.  If you want to run scripts at
system shutdown this was less then ideal since it meant your scripts
also ran at bootstrap.

This change is quite invasive.  It introduces INIT_LEVEL (10) as the
value for runlevel S, meaning all code that parses and/or evaluates
anything for runlevel 0/S was affected and had to be reworked.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 15:11:27 +02:00
Joachim Wiberg 80191f2fd5 plugins: allow building with -D_FORTIFY_SOURCE[=1,2]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 14:28:08 +02:00
Joachim Wiberg 42ef3d3cf7 plugins: add configure support for overriding RTC fallback datetime
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-10 16:35:42 +02:00
Joachim Wiberg 1f4acb322a m4: simplify and fix issue with AC_PLUGIN() going out of bounds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-10 16:33:03 +02:00
Joachim Wiberg c3ba15045b plugins: let dbus start as soon as possible
Some services (openresolv) tries to talk to it very early, so lets get
dbus up and running as soon as possible.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:28:12 +02:00
Joachim Wiberg 8f1d1717f8 initctl: let -n ignore errors from enable/disable as well
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-27 14:27:16 +02:00
Joachim Wiberg 7703d00e82 Fixed TODOs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-21 16:34:34 +01:00
Joachim Wiberg 3bb826b22b Ensure all a process' children are in the same cgroup
The logger redirection process was sometimes in the init group instead
of the system/<svc>/ group.  This was due to the parent PID being moved
after the logger was forked.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-21 16:32:28 +01:00
Joachim Wiberg 9ee2be121f Fix in-service cgroup parser regression
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-21 16:31:43 +01:00