Commit Graph
133 Commits
Author SHA1 Message Date
Joachim Wiberg b8b200ad75 doc: move state machine to inside its section
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-03 12:13:42 +02:00
Joachim Wiberg c148d8d783 doc: document supported types of forking/non-forking daemon's
Issue #223

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-03 12:03:21 +02:00
Joachim Wiberg eeba2960f9 Document new per-service options controlling automatic respawn
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-01-02 07:35:33 +01:00
Joachim Wiberg 1cf204e23d Fix #187: fix typos, including slight clean up
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-01-01 16:37:06 +01:00
Tim Gates 841b06df37 docs: Fix a few typos
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`.
2021-08-27 06:23:04 +10:00
yangfl fa14ed1649 Fix typo
with the love from codespell
2021-06-25 13:08:14 +08:00
Joachim Wiberg 6cd6769997 Update ChangeLog and drop man page TODO
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 16:46:59 +02:00
Joachim Wiberg 03884d3566 doc: fix minor issues, drop 'simply', nothing's simple ..
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 16:35:57 +02:00
Joachim Wiberg 9461ad4d4d doc: add reminders about limitations to sys conditions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 09:04:45 +02:00
Joachim Wiberg 39d879f240 Add support for auto-detetcing OS heading for progress
This patch removes the cognitive overhead of having to manually set your
OS heading, --with-heading="Foo OS vX.YY".  As of this patch, Finit by
default extracts PRETTY_NAME from /etc/os-release.  It is now possible
to also disable the heading entirely using --without-heading

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-05 14:28:49 +02:00
Joachim Wiberg cc6ffa35fc Drop parsing of /proc/cmdline by default, instead use argc + argv[]
For most use-cases the kernel will give Finit its arguments as proper
command line args in argc + argv[], like any other program.  However,
for some users, most notably Alpine Linux, there is a slightly broken
initramfs that cannot forward more than one argument using init_args,
for such systems you can re-enable the old behavior with a configure
switch --enable-kernel-cmdline -- it's not ideal but what can you do.

The main reason for removing this feature by default is to support
use-cases where Finit runs as the init for container apps that can read
/proc -- we do not want them to use the init args from the host.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-31 16:51:08 +02:00
Joachim Wiberg b79245ddb3 Add support for sys/pwr/fail and sys/key/ctrlaltdel conditions
This patch drops the default signal handlers for SIGPWR and SIGINT with
optional tasks in /etc/finit.conf, triggered by two new conditions:
sys/pwr/fail and sys/key/ctrlaltdel, respectively.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-18 08:58:11 +02:00
Joachim Wiberg 31cdc113fc doc: update build instructions and examples
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-17 00:32:21 +02:00
Joachim Wiberg f6f813498b doc: add some info about keventd, what it does
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-17 00:32:11 +02:00
Joachim Wiberg b1a058ccdd doc: update TODO a bit, remember -s for initctl
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-09 14:38:16 +02:00
Joachim Wiberg 53c7ddcb22 Change SIGUSR1 to be compatible with systemd and SysV init
This patch changes the behavior of SIGUSR1.  Previously USR1 could be
used to halt a running Finit system, similar to BusyBox init.  However,
compatibility with sysvinit and systemd has been deemed more important.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-02 14:48:49 +02:00
Joachim Wiberg e6f36974c8 Document all facets of rescue mode; traditional and fallback
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-25 22:46:43 +02:00
Joachim Wiberg 6dced29b49 Add another constraint for the built-in watchdog, device exists
- Check if watchdogd *and* `WDT_DEVNODE` exists before registering the
   built-in watchdogd at boot
 - Update bootstrap.md with this additional constraint
 - Update config.md with references to bootstrap and the new constraint

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-24 10:33:57 +02:00
Joachim Wiberg f6161b9be9 doc: Add blurb on bundled vs external watchdog, handover and reset
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-24 07:41:46 +02:00
Joachim Wiberg 7f76202865 Simplify, drop --enable-fallback-shell from configure script
Recommend using `notty` option in tty stanza instead.  See the updated
docs for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 23:13:19 +02:00
Joachim Wiberg 01358a5a45 doc: update service with pre:script and post:script actions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:37:01 +02:00
Joachim Wiberg 106516d12d doc: update tty config, detail <COND> and @console vs console
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:34:57 +02:00
Joachim Wiberg ba858743e5 Fix #129: add pre:script and post:script action support
This patch updates the service state machine with two new states: SETUP
and CLEANUP.  If an executable pre:/path/to/script is defined for a
service, it is called every time the task goes to READY state.  If an
executable post:/path/to/script is defined for a service, it is called
when the task goes to HALTED state.

Each of these two scripts default to a three (3) second execution time
before they are SIGKILLed.  This can be adjusted with the `kill:SEC`
option for the service.  There are no execution guarantees, nor are
there any way of detecting if the script was killed before completion or
not -- except for running Finit in debug mode and inspecting the result
printed by system_monitor().

Note: the post:script MUST be idempotent since transitions between READY
      and HALTED can take place any number of times before a task goes
      to its RUNNING state.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:33:38 +02:00
Joachim Wiberg 3cf5d36972 doc: example of timed shutdown
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 16:45:33 +02:00
Joachim Wiberg c9ae96bcf7 doc: status of processes now shown in initctl status foo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 16:31:25 +02:00
Joachim Wiberg d53cc8bfe7 doc: Fix run/task/service cgroup config syntax
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 19:51:47 +02:00
Joachim Wiberg 61781c72fe cgroup: Call ifupdown in system cgroup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:21:04 +02:00
Joachim Wiberg b812045d82 doc: add cgroup documentation
First draft of the new cgroup documentation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 14:16:25 +02:00
Joachim Wiberg 03d8ef9c8f doc: drop malplaced comment
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-03-13 09:45:37 +01:00
Joachim Wiberg 1a7092f545 doc: update with new 'initctl cond set|clear foo' commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-03-11 11:44:23 +01:00
Joachim Wiberg b3ea23ed26 initctl: drop old 'job:id' format support, canonical is 'name:id'
With the recent changes to the condition handling it has become more and
more evident that the canonical reference for a task/run/service is the
NAME:ID representation.  Up until now we've kept the older JOB:ID for
some sort of compatibility fallback.

This patch removes the support to simplify maintenance going forward.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-03-04 07:23:19 +01:00
Joachim Wiberg 3b64b155d4 Update build deps, need libite (-lite) at least v2.2.0 for systemf()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-28 23:17:47 +01:00
Joachim Wiberg 4c2bbf7d93 doc: drop lots of fixed or outdated ideas
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-28 10:36:32 +01:00
Joachim Wiberg 70c884816e doc: update config.md, no more limitations
Also, mark some settings as bootstrap only.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-28 09:24:04 +01:00
Joachim Wiberg c001349dd3 Wrapper for init q and init -t sec 0, used by sysvnit shutdown
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-28 07:54:16 +01:00
Joachim Wiberg 6b1ba37438 doc: bump required versions of libuEv and libite
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-26 10:57:30 +01:00
Joachim Wiberg 74d3194775 Follow-up to f4a0b99: track modifications of service env: files
Add support for monitoring environment files for services declared with
the `env:[-]/path/to/file` option.  The default path to such files has
been chosen to follow Debian and Buildroot /etc/default/*

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-25 17:14:26 +01:00
Joachim Wiberg fc82f0242c doc: another reformat of cmdline tips
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 22: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
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 35e4e0d073 Drop confusing splash cmdline and --enable-progress configure option
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>
2021-02-14 20:11:08 +01:00
Joachim Wiberg cac321c16e Minor, simplify
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-11 21:50:45 +01:00
Joachim Wiberg 10d4964106 Remove last traces of inetd support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-11 21:50:17 +01:00
Joachim Wiberg e843be4540 doc: update section on pidfile.so plugin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-11 21:23:09 +01:00
Jacques de Laval cb64c068e3 Fix #136: drop old init client tool
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>
2021-02-11 17:52:08 +01:00