FIFOs, PID files, and other non-devices belong in /var/run (or /run
these days), not /dev -- as per FHS. Compat with Debian SysV init.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The TTY handling in Finit has always been a bit of a patch work. This
commit is an attempt at a first cleanup and simplification.
Included is a brand new built-in getty which should work fine on both
virtual and serial consoles. It is however completely untested on the
latter serial consoles.
Still TODO: add support for /etc/securetty, add support for actually
setting TERM when calling /bin/login.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Embedded Linux systems usually employ BusyBox mdev. This patch assumes
that all non-embedded systems employ udev. Adding support for cleaning
up the udev db after the initramfs, or mounting /dev if that not done.
It also runs the udev-finish script at the end.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Look for 'auto' *and* 'allow-hotplug' in /etc/network/interfaces when
bringing up Debian/BusyBox interfaces at boot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
If the user specifies no 'tty /dev/ttyN' in finit.conf this code
took upon itself to add a backdoor to the system. Let's remove
it and rely on the operator deciding what is best practise.
With this patch no getty, or fallback shell, will be started if
no tty line in finit.conf is available.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds prototype support for the Debian/Ubuntu/Busybox network
configuration file /etc/netork/interfaces. If this file exists Finit
will call `ifup` for each (non-commented-out) interface marked `auto`.
With this implementation we block boot until all ifup commands have
returned, which is less than ideal. A better approach would be to ifup
only loopback and create deferred tasklets to be run in parallel with
the rest of the boot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch fixes a long standing problem with TTY's. The original code
tried to workaround a limitation in the console of some embedded systems
that was detrimental on actual TTYs.
As an added benefit, the console specific "Press Enter" prompt for the
console port is now available on all TTYs -- meaning no getty needs to
be started and kept needlessly in the background until it is needed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We never get any NEWLINK message for lo since it as an interface exists
very early. So we add this workaround when lo comes up so services can
depend on exists for lo as well as for other interfaces.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The introduction of conditions to Finit only focused on
services (monitored daemons) and not parallell one-shot
tasks or blocking one-shot runs.
This patch enables condition support for 'task' and 'run'
stanzas in both finit.conf and finit.d
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
By default the urandom plugin will use /var/lib/misc/random-seed across
reboots to seed /dev/urandom at boot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Do not tag log messages with service description, but use process name.
Possibly add :ID later to denote instance if multiple instances exist.
Also, add priority daemon.info log level.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
If user has no start script fall back to set up at least loopback. This
fixes (at least) a problem on Alpine Linux where `ifup -a` returns error
if `lo` is already up.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Modern systems today use a RAM disk for /run and /run/lock, with
symlinks to the FHS locations in /var/run and /var/lock. See the
following link for details http://lwn.net/Articles/436012/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>