Many users found it very frustrating that it was impossible to use
standard commands like Ctrl-U and Ctrl-D at the login: prompt. It
was never the intention to hamper users for no reason like that.
Also, compensate for cursor-up in "Please press Enter" wait-handler.
Curiously, this makes everything very neat looking also when having
'nowait' enabled for the tty.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Also, while leading with a \n for the activation text and clearing the
line before getty is called, some getty implementations, e.g. BusyBox,
write an extra \n before printing /etc/issue. For perfectionists that
want a single newline separating started services and the first line
of /etc/issue we now not only clear the line, we also move the cursor
one line up before handing over to getty.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The built-in gety in Finit forks but does not execv(). To prevent
confusion on the part of the user, this patch hides all command line
arguments to PID 1 so it won't show up in ps listings of children.
Finit currently reads its arguments from the kernel /proc/cmdline,
it has hard-coded paths to /etc/finit.conf etc. A future version
of Finit may take command line params, in which case this patch
should be moved after any getopt() handling.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The BusyBox hwclock is really bad at handling, or rather displaying,
errors properly. When the kernel signals EINVAL, or ENOENT, it just
shows that message on stderr.
This patch implements proper RTC load/store at boot/halt with quite
some improved error handling suitable for embedded systems.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Similar to how systemd creates cgroups for all services, for purposes of
tracking, Finit now does the same. We also mount all available cgroups
in the /sys/fs/cgroup namespace.
This patch adds support for grouping processes in logical cgroups, like
systemd, and an `initctl ps` command to list the hieararchy.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Allows the service/task name derived from the binary to be
overridden with a custom name.
Example:
service name:dhcpd [2] /usr/sbin/udhcpd -f -- DHCP Server
Signed-off-by: Robert Andersson <robert.m.andersson@se.atlascopco.com>
This patch is an attempt to address an issue with runparts scripts found
by Magnus Malm, @magnusmalm. Any script in:
runparts /foo/bar.d/
were required to have the #!/bin/sh she-bang, otherwise Finit would not
start them. He tested with the standard run-parts tool, which had no
such restrictions.
The patch not only makes sure to start scripts using `/bin/sh -c`
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We can now rely on service_step() to continue stepping run/taks/services
until no more state transitions are made.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Instead of changing the API of service_step(), and relying on all the
different callers to step again, we can schedule another event to do
this for us.
In addition to handling the cond_update() case this also handles all
other callers of service_step(). Ensuring that nested conditions do
trigger changes.
Also, reverting dddd45e fixes a minor regression in service_monitor()
which caused it to not clean up collected bootstrap tasks.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>