8.38. dinit 0.21.0
Build and install dinit as the target system service manager and init-capable supervisor.
Input assumption: dinit-0.21.0.tar.xz is already present in /sources from the chapter 4 source staging step.
Source URL: https://github.com/davmac314/dinit/releases/download/v0.21.0/dinit-0.21.0.tar.xz
Upstream build note: upstream documents dinit as a C++11 project built with GNU make, a C++ compiler, POSIX utilities, and m4 for generating manual pages. The release ships a custom configure script, not an autotools one, and it accepts only its own directory options; this section calls it directly instead of using lbi_configure.
Licenses:
- Apache License 2.0
Dependencies:
- musl (libc)
- clang
- make
- om4
dinit is a service supervisor and init-capable dependency manager. we need it to provide the target system's service manager, service control tools, and shutdown command set.
Extract and Enter the Source Tree
cd /sources
rm -rf dinit-0.21.0
tar -xf dinit-0.21.0.tar.xz
cd dinit-0.21.0
Configure dinit
--disable-capabilities avoids a dependency on libcap, which is not part of the base package set. The remaining Linux service-management features are enabled explicitly so the generated mconfig records the intended target behavior.
./configure \
--prefix=/system \
--exec-prefix=/system \
--bindir=/system/binaries \
--sbindir=/system/systembinaries \
--mandir=/system/documentation/man-pages \
--syscontrolsocket=/run/dinitctl \
--disable-capabilities \
--enable-cgroups \
--enable-ioprio \
--enable-oom-adj \
CXX=clang++
Build dinit
make $LWI_MAKE_FLAGS
Install dinit
make install
Verify dinit
dinit --version
dinitctl --help >/dev/null
dinit-check --help >/dev/null
shutdown --help >/dev/null
dinit, dinitctl, dinit-check, and dinit-monitor in /system/binaries; shutdown, halt, reboot, soft-reboot, and poweroff in /system/systembinaries; and the generated manual pages in /system/documentation/man-pages.
Command Explanations
rm -rf dinit-...andtar -xf: Recreate a clean dinit source tree../configure: Uses dinit's custom configure script directly.--prefix,--exec-prefix,--bindir,--sbindir, and--mandir: Install dinit into the book's/systemlayout.--syscontrolsocket=/run/dinitctl: Sets the runtime control socket location.--disable-capabilities: Avoids Linux capability library integration for this build.make $LWI_MAKE_FLAGSandmake install: Build and install dinit.dinit --versionand the--helpcommands: Verify the installed service manager tools are runnable.