Files
finit/contrib/alpine
Joachim Wiberg a8b113185d Major change, rename <svc/...> conditions to <pid/...> conditions
The <svc/foo> condition was created to synchronize starting services,
hence the abbreviation.  Example: the Quagga ripd needs to start after
the zebra daemon to ensure its UNIX domain socket is active, otherwise
events may be lost.

However, considering that synchronization was implemented with UNIX PID
files, e.g. waiting for /var/run/quagga/zebra.pid to be created, the
condition abbreviation name <svc/foo> was hard to understand by most
newcomers to Finit.  To make matters worse, a new feature to track or
even create PID files for services that don't create one themselves,
using the syntax 'pid:/path/to/foo.pid' was added.

Connecting the dots between these wasn't obvious.

This patch renames service conditions pid conditions and also adds
a compatibility wrapper to the Finit .conf parser.  Any condition
given in old .conf files with 'svc/' prefix are internally renamed
'pid/', along with a LOG_INFO notice in syslog.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-09 22:07:03 +01:00
..
2017-10-18 08:14:29 +02:00

HowTo: Finit on Alpine Linux 3.4-3.6

HowTo use Finit to boot an Alpine Linux system. It is assumed that the user has already installed make, a compiler, C library header files, and other tools needed to build a GNU configure based project.

To start with you need to first install libuEv and libite. They default to install to /usr/local, but unlike Debian and Ubuntu based distros, Alpine's pkg-config does not look for libraries and header files there. So the PKG_CONFIG_LIBDIR environment variable must be used, or change the install prefix to /usr.

The bundled build.sh script can be used to configure and build finit:

alpine:~# cd finit
alpine:~/finit# ./contrib/alpine/build.sh

Then run the install.sh script to install all necessary files, including the sample finit.conf and finit.d/*.conf files. More on that below.

alpine:~/finit# ./contrib/alpine/install.sh

The install script is non-destructive by default, you have to answer Yes twice to set up Finit as the system default init. Pay close attention to the last question:

*** Install Finit as the system default Init (y/N)?

If you answer No, simply by pressing enter, you can change the symlink yourself later on, to point to finit instead of /bin/busybox:

alpine:~/finit# cd /sbin
alpine:/sbin# rm init
alpine:/sbin# ln -s finit init

Before rebooting, make sure to set up a /etc/finit.conf, and /etc/finit.d/ for your services. Samples are included in this directory. Notice the symlinks in /etc/finit.d/, which can be managed by the operator at runtime using initctl enable SERVICE. You can also use a standard /etc/rc.local for one-shot tasks and initialization like keyboard language etc.