Commit Graph
2769 Commits
Author SHA1 Message Date
Joachim Wiberg a2c8e71f14 .github: update dynamic linker cache after installing library deps
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:53:26 +02:00
Joachim Wiberg d1f56e7c2e .github: adjust path for showing finit & intictl usage text
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:46:19 +02:00
Joachim Wiberg a9fd0cbf02 .github: simplify and fix install path
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:32:38 +02:00
Joachim Wiberg be8c89ec00 Bump version for v4.2 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:28:44 +02:00
Joachim Wiberg 4f53752693 .github: install support libs to /usr/local
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:26:54 +02:00
Joachim Wiberg 393673222d Replace Travis-CI with GitHub Actions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-23 09:05:38 +02:00
Joachim Wiberg a88f4524d5 Merge pull request #208 from liuming50/support-more-specific-control-of-services
service.c: add more parameters when starting services
2021-09-23 08:46:42 +02:00
Joachim Wiberg 3a02066a66 Merge pull request #206 from liuming50/dont-hard-code-dbus-user-pidfile
dbus: dont hard-code daemon user/pidfile
2021-09-23 08:31:19 +02:00
Joachim Wiberg 7e3981d1a3 Merge pull request #205 from liuming50/fix-a-wrong-header-include
Fix a header including syntax
2021-09-23 08:30:20 +02:00
Robert Andersson ec2900e4dd service.c: add more parameters when starting services
It would be good if we can control the services more specifically with
the following parameters like:

restart:N   - how many times shall the service to be restarted on
              failures (<10), the default max is 10.
restart_tmo - the timeout of the restarting.
norestart   - dont restart on failures.
oncrash     - once all retrying also fail, how to deal with it,
              rebooting or ignoring the failures.

Signed-off-by: Robert Andersson <robert.m.andersson@atlascopco.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-21 10:55:29 +02:00
Ming Liu d718a27abf dbus: dont hard-code daemon user/pidfile
Both DBUS user and pidfile is configurable in DBUS compilation, by
passing "--with-dbus-user=" and "--with-system-pid-file=", let's avoid
hard-coding them here, use macros instead.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-21 10:48:25 +02:00
Ming Liu db8027911c Fix a header including syntax
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-21 10:47:15 +02:00
Joachim Wiberg aef3b4117d Merge pull request #200 from liuming50/dont-hard-code-nologins-file
Dont hard-code nologin file
2021-09-18 09:48:43 +02:00
Ming Liu 6728b77aca Dont hard-code nologin file
It's configurable in /etc/login.defs as NOLOGINS_FILE, avoid to hard
coding it here, introduce a macro FINIT_NOLOGIN_PATH instead which is
configurable from compiler flags, it's not defined, then back to
_PATH_NOLOGIN from /usr/include/paths.h.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-17 13:10:01 +02:00
Ming Liu a7c0b42965 configure.ac: add fastboo/fsckfix to config summary output
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-10 11:35:45 +02:00
Joachim Wiberg 667b6ecbbd Merge branch 'liuming50-introduce-two-more-config-options' 2021-09-09 09:10:46 +02:00
Joachim Wiberg b852878a4a Follow-up, coding style fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-09 09:10:16 +02:00
Ming Liu 940f1f7486 Introduce two more configure options
fastboot: once enabled, fsck would be skipped on filesystems listed in
          /etc/fstab.
fsckfix: once enabled, 'fsck -ys' would be run instead of 'fsck -a',
         and check the return value larger than 1 as a failure and goes
         to login console.

They are both disabled by default, no functional changes unless an end
user choose to enable them.

The idea derives from Sysvinit's "FASTBOOT" and "FSCKFIX".

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-09-09 09:08:14 +02:00
Joachim Wiberg 49c705b5ad Merge pull request #201 from liuming50/fix-a-memleak
Fix a memleak.
2021-09-09 09:04:42 +02:00
Joachim Wiberg 5163e8a433 Merge pull request #198 from timgates42/bugfix_typos
docs: Fix a few typos
2021-09-09 08:56:07 +02:00
Joachim Wiberg 71e9603e4e Merge pull request #199 from liuming50/drop-c++-key-word
Avoid using C++ key words
2021-09-09 08:55:39 +02:00
Joachim Wiberg c71102f44e Merge branch 'liuming50-fix-a-unmount-issue' 2021-09-09 08:51:41 +02:00
Joachim Wiberg 9b9158a765 Follow-up, coding style and drop extra print()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-09-09 08:51:26 +02:00
Robert Andersson 595e2b4e81 Ensure all filesystems listed in /proc/mounts are unmounted
The iterator function getmntent() is not stable. It may skip
entries if the contents of the iterated file changes, which
is the case with /proc/mounts when filesystems are unmounted.
As a result, some filesystems were never unmounted.

To fix this, iteratation is now restarted after every
sucessful unmount.

Signed-off-by: Robert Andersson <robert.m.andersson@atlascopco.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-08-30 10:16:00 +02:00
Ming Liu ae8e205343 Fix a memleak.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-08-29 14:02:04 +02:00
Ming Liu 00b33fbd42 Avoid using C++ key words
"protected" is a C++ key word, replace it with "is_protected" avoid
compiling failures with C++ compiler.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2021-08-29 10:35:08 +02: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
Joachim Wiberg 522a06f864 Merge pull request #181 from yangfl/typo
Fix typo
2021-06-25 07:43:08 +02:00
yangfl fa14ed1649 Fix typo
with the love from codespell
2021-06-25 13:08:14 +08:00
Joachim Wiberg 64e41e066b Change default loglevel to LOG_INFO from LOG_NOTICE
We've had several logit() messages of LOG_INFO level that never
really made it to syslog because we classified it as "debug".

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 17:20:17 +02:00
Joachim Wiberg 2a71f35005 Reduce log level of watchdog handover, this is not an error condition
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 17:20:17 +02:00
Joachim Wiberg 961a337a5e Minor, we no longer know if it's an external or bundled getty
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 17:20:17 +02:00
Joachim Wiberg f0622a692e Minor, format style change of comment block
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 17:20:17 +02:00
Joachim Wiberg ef7042dd9d finit: early log, "entering runlevel S", just after printing banner
This patch adds "the missing" first runlevel log entry when Finit has
printed the console banner and begins its bootstrap phase.

At this point we know syslogd hasn't been started yet, so we rely on
logit() to redirect this to /dev/kmsg in the meantime.  Later syslogd
will pick this up, see that it's not from the kernel, and log it to
the proper log file.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 17:20:17 +02:00
Joachim Wiberg 046ecfa329 Fix #180: user managed services started by initctl reload
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-14 13:16:14 +02:00
Joachim Wiberg 47fbe49861 Wrap all mount(2) calls so we at least get an error message
If any of these mount() calls fail, not counting EBUSY because that
would mean sth is already mounted, there really isn't much we can do.
So the least we should do is warn on console if it happens.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-14 11:20:08 +02:00
Joachim Wiberg 2f34315634 fnread(): make sure to NUL terminate buffer
Note, this is dead code, currently unsused in Finit.  Possibly an
external plugin makes use of it, but even that is highly unlikely.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-14 11:19:57 +02:00
Joachim Wiberg c8d6ad6546 Bump version for v4.1 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
4.1
2021-06-06 17:30:48 +02:00
Joachim Wiberg 3dfae3074e Revert "Travis-CI: disable clang for Coverity run"
This reverts commit 8e1845f57b.
2021-06-06 17:05:09 +02:00
Joachim Wiberg 97bebe52c9 Fix logic expression in release_heading(), found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 16:57:52 +02:00
Joachim Wiberg 8e1845f57b Travis-CI: disable clang for Coverity run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 16:50:51 +02: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 899925e249 man: initial manual page for finit.conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 16:35:37 +02:00
Joachim Wiberg efefa398ce man: initial manual page for initctl
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 12:57:21 +02:00
Joachim Wiberg 1ee24c69bc Sync with man page
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 12:50:03 +02:00
Joachim Wiberg b16a36980c man: initial manual page for finit
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 12:50:03 +02:00
Joachim Wiberg c1b52bbc04 contrib: debian: depending on the setup, a user may not need elogind
I'm writing this in X started on a system running Finit v4.1-pre that
does not have elogind installed.  It does, however, still have systemd
installed, so systemd-logind is available.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 09:05:13 +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 e2ef6e9c34 plugins: sys: drop conditions not affecting any svc_t
- Fix bug when calling sys_update_conds() when dir already exists
  and we're not being called from the scandir() handler.  I.e.,
  every time but the first for each new condition sub-family

- Drop sys conditions that don't affect any svc_t.  This may seem
  counterintuitive, and we should probably not use oneshot conds,
  but if we leave these conds asserted they may cause inadvertent
  trigger if a finit.conf is loaded which ha this sys cond.  E.g.,
  if ctrlaltdel is asserted and we enable a task in finit.conf and
  call `initctl reload`, the task would start immediately, even
  though ctrl-alt-del may have been pressed a week ago

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-06 00:34:11 +02:00