Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

77.4. sysklogd-2.7.2

System logging daemon with built-in rotation

Version 2.7.2, release 1
Shelf base — The minimal userland and system daemons that every KDOS image boots with
Phase 41_system (System), 197 of 1047 in build order
Licence BSD-3-Clause
Homepage https://github.com/troglobit/sysklogd
Build time 0.1 SBU
Installed size 483.3 KiB in 18 files
Recipe ports/core/base/sysklogd/kpkgbuild

About

sysklogd provides syslogd, the system log daemon. It receives the messages programs send to /dev/log and reads the kernel’s own messages itself, so there is no separate klogd, and it writes them to files under /var/log according to /etc/syslog.conf. It is KDOS’s replacement for journald (see No systemd).

/etc/init.d/22_syslog.sh starts it at boot under the ksvc supervisor, before the network comes up, with three options:

The script also makes /var/log/auth.log mode 0600 before syslogd opens it: syslogd creates a missing file 0644, readable by every account, and keeps whatever mode a file has when it rotates it. Which messages go to which file is in Logs.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/base.txt:

The logs. Without them every daemon's diagnostics go to /dev/null.

Sources

Dependencies

Depends on: nothing a recipe names.

Required by: no port names it.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install sysklogd'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/base/sysklogd.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/base/sysklogd
echo 'bc410ca64551a11fac6518b418fb6b8afbd888a70af2c5eb353334a706727bca  sysklogd-2.7.2.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/sysklogd
SRC=$SRC_ROOT/sysklogd-2.7.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf sysklogd-2.7.2.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--localstatedir=/var \
	--runstatedir=/run \
	--disable-static \
	--without-systemd \
	--without-logger

make
make DESTDIR=$PKG install

install -d "$PKG/etc" "$PKG/var/log"

cat > "$PKG/etc/syslog.conf" <<'EOF'
# facility.level                        destination
auth,authpriv.*                          /var/log/auth.log
*.*;auth,authpriv.none                  -/var/log/messages
kern.*                                  -/var/log/kern.log
cron.*                                  -/var/log/cron
*.=emerg                                *

# Rotation is GLOBAL directives, not per-file suffixes. Writing
# `/var/log/messages rotate_size=1M` puts the path where a facility.priority
# selector belongs and syslogd answers `unknown priority name ""` for every
# such line.
rotate_size  1M
rotate_count 5

# No network socket at all. With no `listen` line syslogd otherwise opens UDP
# *:514 and accepts any host's messages into these files. 1 would keep
# forwarding to a remote `@host` action without listening; 2 is neither.
secure_mode 2
EOF

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/sysklogd, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf sysklogd-2.7.2-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/sysklogd, and runs the triggers its paths call for.

Contents

Installed programs: syslogd.

Installed libraries: libsyslog.so.

Installed directories: /usr/include/syslog, /usr/share/doc/sysklogd, /usr/share/licenses/sysklogd.

Short descriptions

syslogd log systems messages
libsyslog.pc RFC5424 compliant syslogp() API and syslog() replacement from sysklogd

Notes

The recipe writes /etc/syslog.conf itself, and its comments are what a reader of the installed file sees. Two of its rules are easy to get wrong when editing it: