This patch removes the following very annoying warning for TTY devices
not yet available, i.e. plugged-in to the system.
Loading configuration ............................................................................. [ OK ]
[ 11.097414] finit[1]:tty_register():Incomplete or non-existing TTY device given, cannot register.
[ 11.101457] finit[1]:tty_register():Incomplete or non-existing TTY device given, cannot register.
Mounting filesystems .............................................................................. [ OK ]
Finit will not start a getty (built-in or external) if the TTY does not
exist, but having the configuration enabled makes it possible to do a
simple `initctl reload` to activate a plugged in TTY.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
In case the kernel is incapable of handling a reboot,
power-off, or halt request we want to be able to let
the user perform some basic diagnose of the system.
The existing debug messages are good enough, and use
the correct grammar form, to be enabled always.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When collecting a bootstrap task we need to allow its state machine to
complete before cleaning them out.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
During the runlevel change from S --> 2 the state machine will pause,
waiting to collect all S-only tasks/services, before continuing.
When an S-only task/service is collected we therefore need to call the
state machine again so that it can reassert all conditions properly.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We should not let PID 1 fail on systems where Linux is built without
CONFIG_SYSVIPC, or the libc does not support shmget()/shmat().
This workaround implements a fallback to using calloc() for PID 1,
which means the initctl tool will not work properly. A better fix
would be to refactor the shm implementation to instead have initctl
call Finit using api.c for each svc_t. This has been added to the
TODO file as future work.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Building finit with a uclibc-ng-toolchain fails with:
```
../src/helpers.h:53:43: error: unknown type name ‘va_list’
void printv (const char *fmt, va_list ap);
```
This patch enables support for bootstrap services in /etc/finit.d/
Please note, however, that this does not mean that all configuration
directives are now allowed in /etc/finit.d/*.conf -- the intention is
only to simplify distribution setups.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
A run stanza blocks operation by calling waitpid(), so it will never be
caught by the service_monitor() function. Hence, we need to clean up
any bootsrap calls after waitpid(), or at least perform a manual state
change.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch extends the capabilities of task and run .conf stanzas by
enabling pipes and redirects.
Example:
task [s] echo "foo" | cat >/tmp/bar
run [s] echo "$HOME" >/tmp/secret
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch aligns the two tty configuration stanzas, thus clear and wait
are now the default for both.
tty [LVLS] <DEV> [BAUD] [noclear] [nowait] [TERM]
tty [LVLS] <CMD> <ARGS> [noclear] [nowait]
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch makes it possible to disable the "Please press Enter" prompt
when using an external getty. Simply append `nowait` to the .conf entry
and Finit will spawn the getty immediately.
A future patch will add support for `noclear` as well to external getty,
as well as a change in default (=> `wait`) for the built-in getty.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
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>