When logging out from the shell, e.g. with Ctrl-D, artifacts from that
session may remain on the current line. This patch makes sure to clear
up that line before issuing a newline and starting the built-in getty.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Refactor code to figure out device so it works for both the built-in
and external getty code paths
- Fix memory leak when user edits an existing tty device
- Replace @console in argument list to external getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
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>