Commit Graph
2151 Commits
Author SHA1 Message Date
Jacques de Laval 407c524088 test: Use FINIT_CONF from autoconf instead of hardcoded /etc/finit.conf
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-22 14:34:22 +01:00
Jacques de Laval 765e1eb640 Merge branch 'master' into wip-tests 2021-02-21 12:52:30 +01:00
Jacques de Laval a8f562a7f5 test: Minor clean up
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-21 12:51:49 +01:00
Joachim Wiberg 7e42203627 Fix #147: refactor reboot as multi-call to initctl
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>
2021-02-21 10:59:08 +01:00
Joachim Wiberg 649a269526 Add reboot/halt/poweroff/suspend commands to Finit API
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 10:49:13 +01:00
Joachim Wiberg e80edbb401 If Finit API call fails (NACK), return non-zero to client
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 10:47:48 +01:00
Joachim Wiberg 1cb37a3ee7 plugins: update conditions for udevd and udevadm commands
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>
2021-02-21 01:12:26 +01:00
Joachim Wiberg 27a4c8cd9a Follow-up to 70ca64a, handle missing bool argument to cmdnline opts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 01:06:02 +01:00
Joachim Wiberg 97a0baaf93 Fix regression introduced in 13893b9
The refactor in 13893b9 caused a regression in composing service
arguments.  This patch should rectify that.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 00:57:21 +01:00
Joachim Wiberg 7b561044a9 doc: slight refactor of signals document 2021-02-21 00:57:12 +01:00
Joachim Wiberg 346320f669 doc: update text on conditions to reflect new world 2021-02-21 00:57:12 +01:00
Joachim Wiberg e941a510c1 doc: document new cmdline options
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 00:57:03 +01:00
Jacques de Laval 835f6a45d3 test: Re-enable teardown
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 14:30:12 +01:00
Jacques de Laval ee71378dfd test: Fix hardcoded Finit TTY pipe
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 14:20:09 +01:00
Jacques de Laval 0161958603 test: Avoid shadwoing /tmp/lib in Travis CI
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 14:08:37 +01:00
Jacques de Laval dd6af87d6e test: Print Environment and FS for debugging 2021-02-20 13:49:12 +01:00
Jacques de Laval 7965dbd13f test: Fix chroot not in PATH
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 13:06:28 +01:00
Jacques de Laval 99ad26236e test: Fix unshare/nsenter not in PATH
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 12:39:29 +01:00
Jacques de Laval ba621502ae .travis.yml: Print unshare/nsenter/chroot version for debugging
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 11:53:20 +01:00
Jacques de Laval 061702b6e4 .travis.yml: Run check after build
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 11:09:22 +01:00
Jacques de Laval e72fd5a271 test: Fix and clean up dynamic library setup
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-20 11:05:41 +01:00
Jacques de Laval c80a755dc6 test: Clean up Makefile
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 22:49:01 +01:00
Jacques de Laval 5a4cb74493 test: Fix shellcheck warnings
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 21:29:51 +01:00
Jacques de Laval 5775a20eff test: Copy dynamic libraries into chroot
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 20:54:35 +01:00
Jacques de Laval cdd504622d test: Print test status after each test
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 15:05:45 +01:00
Jacques de Laval 39edf52792 test: Add shellcheck
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 14:39:55 +01:00
Jacques de Laval 4224c2e8fe test: New test: test_start_stop_service
Add a new test that verifies that Finit will:
- Start a service that's been added to the config
- Stop the service once it's removed from the config

The second step is currently failing.

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-18 13:55:47 +01:00
Jacques de Laval 4f82cb8261 WIP: test makefile 2021-02-18 00:47:55 +01:00
Jacques de Laval aa9a5fbb99 WIP: Unshare/Chroot test wrapper script 2021-02-17 16:20:17 +01:00
Joachim Wiberg dda59503ac Refactor, drop #ifdefs and logger fallback, probe for logit
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>
2021-02-17 13:00:58 +01:00
Joachim Wiberg 549aeda1fd Set process name of finit fallback shell, when active
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 13:00:22 +01:00
Joachim Wiberg 5903ebeb62 cgreaper.sh: update path to logit after relocation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 13:00:22 +01:00
Magnus Malm 4d4fd40286 Follow-up to 72a892e, Add missing '/'
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-17 11:46:39 +01:00
Joachim Wiberg 27aa7ad1e1 Follow-up to 72a892e, fix string concatenation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:41:49 +01:00
Magnus Malm 72a892ef55 Fix #151: Install logit in libexec
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-17 11:33:48 +01:00
Joachim Wiberg 4ff6f6a1f1 doc: minor, pid condition syntax has changed
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:32:47 +01:00
Joachim Wiberg 07da8aecac doc: some helpful pointers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:32:13 +01:00
Joachim Wiberg 352ffb1582 doc: Major refactor, change layout
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:26:49 +01:00
Joachim Wiberg ad08f30b31 doc: Simplify and update with new cond format
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:06:46 +01:00
Joachim Wiberg 13893b9f32 Refactor, simplify command + args composition for readability
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:06:46 +01:00
Joachim Wiberg e5a53c175a initctl: fix too long cmd arglist with 'initctl -v show'
Only append args that have length, MAX number of args are many.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 11:06:46 +01:00
Joachim Wiberg 224fbedbf4 Merge pull request #153 from troglobit/logit-post-signal
Logit post SIGTERM, SIGINT etc.
2021-02-17 10:56:20 +01:00
Magnus Malm 97196d6520 contrib: alpine: Add finit builtin watchdog daemon
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-17 10:34:10 +01:00
Jacques de Laval 06aea7d3f3 Keep logit alive until stdin is closed
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>
2021-02-17 00:00:50 +01:00
Jacques de Laval 703ae0caf3 Avoid lingering stdout fd logit process
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>
2021-02-17 00:00:37 +01:00
Magnus Malm 20c5788430 contrib: debian: Change sshd config to use absolute path
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-15 13:53:22 +01:00
Joachim Wiberg d449329d3d Merge pull request #152 from troglobit/fix#139-set-system-timezone
Fix #139: System timezone changes does not 'take' in Finit
2021-02-15 13:43:16 +01:00
Andreas Egeberg 65f25756bf Fix #139: System timezone changes does not 'take' in Finit
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>
2021-02-15 12:38:20 +00:00
Joachim Wiberg 272db0d41d Use fallback to syslog if logit tool is not installed
In the case of redirect to a logfile, if logit tool is not enabled,
then log to syslog instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-15 08:00:24 +01:00
Joachim Wiberg 47d89ba2f6 contrib: Drop --enable-progress, enabled by default now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-14 20:53:52 +01:00