- Changing the GNU defaults is messy. The best way is to leave them
alone and let the user set their install locations themselves.
- Show --exec-prefix in config Summary, that's where the binaries go
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
From the start, the output from the 'list' command has been different
from the output of the 'show' command. No longer.
Also, drop the 'AVAILABLE', 'ENABLED', and 'STATIC' prefixes. They were
a bit screamy and superfluous. 'STATIC' wasn't even a good name for the
locally administered ones.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
All Debian based distros are moving towards a /etc/network/interfaces.d/
world. Adding support for that is too complex, so we're reverting back
to calling 'ifup -a' or 'ifdown -a'. We still guard this by checking
both for 'ifup' and the existence of /etc/network/interfaces (which in
the new world only contains a line to source per-interface files).
By popular demand, this patch also changes to bring up/down networking
in the background. Useful for embedded system bringup and containers.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Even musl libc supports %m today, as well as most syslog daemons, but
that's no excuse to use this.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Some targets, like Raspberry Pi, have both serial and HDMI console
enabled. Depending on the order of arguments on the kernel cmdline
either one were selected the default 'stderr', which finit used.
This patch adds support for parsing the console= string(s) and
opening multiple outputs for system startup/progress. In the
end, however, a getty still needs to be started on each of the
consoles to use.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We need /proc for rs_remount_root() and conf_parse_cmdline(), /dev for
early multi-console support, and /sys for the cgroups support. All of
these may be in the system /etc/fstab, which fs_mount() later remounts.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Many systems have a very verbose kernel by default. This patch calls
`klogctl(SYSLOG_ACTION_CONSOLE_OFF, NULL, 0)`, which is sysklogd also
calls but later when it starts emptying /dev/kmsg.
We do this to get an undisturbed console while starting up.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This seems to be inline with Busybox init, SysV init and, according
to the comments in code, the intended behaviour of Finit.
The effect is that `SIGPWR` will lead to Finit issuing the syscall `reboot`
with `cmd` parameter set to `RB_POWER_OFF` (rather than `RB_AUTOBOOT`), which
in turn will lead to a halt rather than a reboot.
The effect of the above inside a PID namespace other than the initial PID
namespace is that `wait` inside the parent of Finit will report that Finit was
killed with a `SIGINT` signal rather than `SIGHUP`.
The contents of /etc/finit.conf and friends could potentially change
after mounting /etc/fstab. If, for example, /etc was to be re-mounted
from ro to rw using an overlay filesystem, we want any user changes to
the configuration to take effect.
Instead of heuristically trying to determine the correct hotplug
daemon to use (mdev/udev), defer to the user to specify it in the
configuration. Same goes for the built-in watchdog.
Traditionally, Finit has setup _some_ filesystems that are Nice To
Have (tm), using options that do the Right Thing (tm).
On the one hand, this is very convenient for users that don't
necessarily know what a reasonable mode= value is for /tmp etc. (pun
intended). It also means that mountpoints can be created if they
don't exist.
On the other hand it means that all users are forced to submit to the
choices made by Finit. Also, different filesystems where spread out
at many different points in `main()`, meaning that the fact that
`/proc` was available at a given hook point did not imply that `/sys`
was, for example.
Instead, defer _all_ filesystem setup to the user by simply calling
`mount -a`. We then ship an example `fstab` that shows how to
re-create the old behavior.
This patch to the banner "hello" is hopefully the last in this new style
progress. Previous efforts have used unicode symbols not available in
all fonts. This time we standardize on one that looks good both the
default Ubuntu Mono and Source Code Pro fonts. It's a bit small in my
preferred font, Envy Code R, but that might be a mistake in the font.
Not tested with PuTTY or Windows Hyper Terminal. I think they use the
Courier font by default, both of them, which I have tested.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Some ppl have their own '.' in service descriptions, adding anther just
messes things up and is confusing. The old style progress still adds
dots, but thats for padding up to [ OK ].
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Because we want to reserve @console for going dumpster diving in
/sys/class/tty/console/active and 'console' to mean the literal
/dev/console
This reverts commit 217df432d6.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Up until now Finit has only read /proc/cmdline to determine debug level,
single user mode, etc. This patch is one in a series to make enable it
to run also in containers.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Define MODULES_LOAD_PATH only when it's unset, this allows it to be
overridden, for instance, by passing CFLAGS.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This patch makes the RTC plugin a bit more stand-alone, it is now also
back in the hands of the user to set a default timezone.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Most of the helper functions around TTYs assumed that STDIN_FILENO was
already set up and unique for the give TTY they operated on. It turns
out it wasn't. This patch refactors the open() of TTYs to ensure we
do not clobber our TTY settings with multiple calls to tcsetattr() for
the same TTY.
Took a while to track this one down. Usually I don't run systems with
more than one TTY, but the Alpine system on my home server did, and boy
I've never been this close to giving up on computers, ever.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
On Alpine Linux 3.6 the tcsetattr() calls failed. This turned out to be
a deeply rooted issue not limited to just musl libc. The workaround is
to call tcsetattr() in several rounds. In particular the modem signals,
c_cflag bits, always fail, so we take a bet on Linux having set up the
terminals (hope as a strategy) and ignore that problem, for now.
Also, use TCSAFLUSH with tcsetattr(), that seems to work better and is
what BusyBox stty use.
The local CTL() macro is replaced with CTL() from ttydefaults.h, which
exists also in musl libc.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The svc_find_by_pidfile() function is called async from the pidfile
plugin, so by the time the queue is processed the origin may have
moved or been removed even. Safe to ignore.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>