106.28. babeld-1.14
Babel routing daemon — routes across a mesh of wired and wireless links
1.14-1 · MIT · 0.1 SBU · 206.0 KiB, 4 files · 41_system, 820 of 1047 · ports/core/network/babeld
Homepage: https://www.irif.fr/~jch/software/babel/
babeld is the reference implementation of Babel, a distance-vector routing protocol for networks that mix wired and wireless links, such as community meshes. 31_babeld starts it only once /etc/babeld.conf exists and is not empty, so an image that routes nothing runs nothing.
Depends on: nothing a recipe names.
Required by: no port names it.
Sources: babeld-1.14.tar.gz (1.0 MiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install babeld'
build.sh:
make CDEBUGFLAGS="$CFLAGS -Wall"
make PREFIX=/usr TARGET=$PKG install
install -d "$PKG/etc/init.d"
cat > "$PKG/etc/init.d/31_babeld.sh" <<'KDOS_SH'
#!/bin/bash
. /etc/init.d/service_helper
NAME="babeld"
DAEMON="/usr/bin/babeld"
CONF="/etc/babeld.conf"
case "$1" in
start)
[ ! -x "$DAEMON" ] && { echo "[SKIP] $NAME: $DAEMON not found"; exit 0; }
if [ ! -s "$CONF" ]; then
echo "[SKIP] $NAME: no $CONF"
exit 0
fi
echo "[KDOS] Starting $NAME..."
supervise "$NAME" "$DAEMON" -I '' -c "$CONF" -S /var/lib/babeld/state
;;
stop) stop_service "$NAME" ;;
status) check_status "$NAME" ;;
*) echo "Usage: $0 {start|stop|status}"; exit 1 ;;
esac
KDOS_SH
chmod 755 "$PKG/etc/init.d/31_babeld.sh"
install -dm755 "$PKG/var/lib/babeld"
-I ''— No pid file. babeld’s default,/var/run/babeld.pid, is opened withO_EXCL, so a file left by a babeld that was killed makes the next one exit at once, and the supervisor would restart it every few seconds. The supervisor already knows the daemon’s pid and keeps it in/run/kdos-svc.babeld.pid.-S /var/lib/babeld/state— Where babeld keeps what it needs across a restart, in a directory the package creates, in place of upstream’s default/var/lib/babel-state. When the file is missing, a started babeld runs in passive mode for three minutes, and its neighbours may ignore it at first.
Programs: babeld.
Directories: /usr/share/licenses/babeld, /var/lib/babeld.