Files
rpi-buildroot/package/docker-engine/dockerd-syslog-wrapper.sh
Fiona Klute (WIWA) 65c8e4c651 package/docker-engine: add wrapper script for logging to syslog
Dockerd logs only to stdout/stderr [1], which is lost with
--background. The upstream SysV init script [2] logs to a file by
passing --no-close to start-stop-daemon and redirecting the output,
but that option is not supported by Busybox' start-stop-daemon.

The wrapper script added with this commit captures the output of
dockerd (or whatever other command it is given) and forwards each line
to syslog.

[1] https://github.com/moby/moby/discussions/48260
[2] 50c3d19179/contrib/init/sysvinit-debian/docker

Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-08-15 14:53:28 +02:00

5 lines
93 B
Bash

#!/bin/sh
"${@}" 2>&1 | while read -r LINE; do
logger -t "$(basename "${1}")" "$LINE";
done