Commit Graph
29 Commits
Author SHA1 Message Date
Joachim Nilsson 00fe37174d Refactor initial /dev popoulation
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-18 09:57:38 +02:00
Joachim Nilsson 33916a2097 Fix #82: Revert parts of 34a1524 and add workaround from Void Linux
In commit 34a1524 the start of udevd was refactored to allow it to be a
properly monitored service caused systems using eudev to malfunction.

This patch reverts part of that commit and adds a workaround found when
trying to reproduce issue #82 on Void Linux:

   - Start a temporary udevd in the background
   - Call udevadm to trigger bringup of all subsystems and devices
   - Wait for everything to settle
   - Tell temporary udevd to exit (new)

In the world of `mdev` this song and dance act is not required.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-18 09:43:37 +02:00
Joachim Nilsson e88241316b Prune bootstrap tasks/services that never ran
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-16 09:42:08 +02:00
Joachim Nilsson a6a3299f08 Free cmd from which() after having registered the udevd service
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-15 23:10:42 +02:00
Joachim Nilsson 34a15241ca Convert udevd to a regular system service
This patch, similar to the work done in the d-bus plugin, converts the
udevd service from a non-monitored run_interactive() task that forks
itself into the background, to a proper Finit monitored service.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-15 23:10:18 +02:00
Joachim Nilsson 0f09c1b0dc Minor, comment fix
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-10 22:53:05 +02:00
Joachim Nilsson 2d9c147e0e Minor, fix comment within comment GCC warning
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-09 09:03:58 +02:00
Joachim Nilsson 56eec5164d Minor, update code comment
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-09-25 19:02:19 +02:00
Joachim Nilsson a2f4b35e4e Fix #77: Remove deprecated startx and user .conf settings
It is strongly recommended to instead use the service stanza to start
XDM/GDM, or use startx after a regular login.

Note: the `user NAME` setting was always reserved for use with startx

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-08-30 15:01:05 +02:00
Joachim Nilsson 054baed134 Reap zombie processes in emergency shell mode, issue #76
The emergency shell is just a Finit debug mode.  This patch adresses a
concern from GitHub issue #76, with zombie processes in this mode.

Emergency shell could be further improved, e.g. informing the real Finit
process of each collected child (zombie) to be restarted if needed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-08-15 08:09:19 +02:00
Joachim Nilsson 963b736d8b tty: Refactor, remove useless runlevel argument
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-09 15:05:32 +02:00
Joachim Nilsson 6676d4b50c Silence service start/stop *before* launching TTYs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-08 11:04:50 +02:00
Joachim Nilsson 115b5f1ca7 Add HOOK_BANNER for plugins to override the default Finit banner()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-08 00:07:21 +02:00
Joachim Nilsson 878885e2b2 Load plugins much earlier, for future banner plugin
This patch moves the plugin loader much earlier, making it possible to
provide a custom banner/logo in a plugin.

To facilitate this move we need to also move banner later and parsing
of the kernel cmdline earlier, right after mouting /proc.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-08 00:05:07 +02:00
Joachim Nilsson 769659767c Minor, comment fixes only
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-04 21:12:54 +02:00
Joachim Nilsson 99818f9ce0 Convert banner() and printv() to use new screen_init() values
This patch changes the traditional look of the Finit boot sequence.
Now we stick to the screen width probed by screen_init(), or max
132 chars.

Also, some minor cleanup of the currently unused print_timestamp()
method used by printv() when showing [ OK ] or [FAIL] of services
at boot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-04 20:59:49 +02:00
Joachim Nilsson be6f0de0df Add util.c:screen_init() to probe screen size once per boot
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-04 20:58:43 +02:00
Joachim Nilsson 6f61e8e915 Remove hard-coded paths to system tools available in $PATH
Since at least a44daf2 both run() and run_interactive() can access all
system tools in _PATH_STDPATH.  A system that uses non-standard paths,
e.g. /system/bin and /apps/bin, should update _PATH_STDPATH.

For reference, see issue #69 and PRs #70 and #72.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-03 13:18:42 +02:00
Joachim Nilsson 9c6e046d93 Remove hard-coded paths to system tools available in $PATH
This patch implemements a new feature of libite v1.9.1, whichp(), which
instead of fexist() that requires an absolute path, searches $PATH.

For reference, see issue #69 and PRs #70 and #72.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-03 13:13:55 +02:00
Joachim Nilsson 516dbcc512 Remove --disable-quiet and quiet mode, default to a sane behavior
This patch is a follow-up to 1f1c2e0 which introduced the new semantics
for the very confusing quiet and silent modes.

The initial idea was to loosely follow the kernel cmdline 'quiet' option
and as a working concept this was good.  The resulting code, however,
became unnecessarily complex and the configure options impossible to
explain.

With this patch the quiet mode, and thus the --disable-quiet configure
option, is removed.  Finit now defaults to a sane behavior: services are
shown only at startup.   The --enable-silent option works like it did
before, silencing everything.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 13:40:54 +02:00
Joachim Nilsson cd947a69a8 log.c: New functions to hide access to quiet and silent flags
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:42:44 +02:00
Joachim Nilsson 51e1a907e6 log.c: New log_is_debug() function, hide access to debug variable
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:40:50 +02:00
Joachim Nilsson 82661346b7 Follow-up to 885056a, collapse and simplify code
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-01 20:34:26 +02:00
crazy 885056a6c9 networking(): check first ifup exists
Check first ifup exists before using it since
   this is really something only exits on some
   distros an in different ways. Debian/Ubunu has
   an package for this while others have it in the
   initscripts package(s) , meaning the file can be
   around even without the prog.

Signed-off-by: crazy <crazy@frugalware.org>
2017-03-28 13:21:20 +02:00
crazy a44daf20cb finit.c: set _PATH_STDPATH much earlier
This should allow us to run 'prog' without
     absolute paths.  Eg:

     run("/bin/foo"); -> run("foo");

     However we still need absolute PATH for
     checking since fexist() need full path right now.

Signed-off-by: crazy <crazy@frugalware.org>
2017-03-28 13:21:18 +02:00
Joachim Nilsson c135a83cb3 Check if /proc/bus/usb exists before trying to mount it
Most newer kernels have usbfs disabled by default.
See issue #69 for details.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-03-20 20:41:09 +01:00
Joachim Nilsson 8d74a12628 Fix #64: Skip fsck of already mounted devices
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-24 08:03:53 +01:00
Joachim Nilsson 33ae64495a finit.c: Mount /proc and /sys before fsck()
For issue #64 we need to have /proc/mounts, or /etc/mtab but that's
usually symlinked to /proc/mounts.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-24 07:57:19 +01:00
Joachim Nilsson fff68b7b06 Relocate source files to an src/ subdirectory
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-01-16 01:31:02 +01:00