diff options
-rwxr-xr-x | src.etc/init.d/rc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src.etc/init.d/rc b/src.etc/init.d/rc index 0c81e9e..6747dd0 100755 --- a/src.etc/init.d/rc +++ b/src.etc/init.d/rc @@ -7,8 +7,26 @@ # This file may be reproduced, distributed, modified, and otherwise dealt in # under the terms of the Expat/MIT License. +LF=' +' + [ -x /usr/bin/logger ] && logger='logger -p 6 -t sysinit' || logger=cat +# Buffer log lines until syslogd is running. +log() +{ + local line= + local buf= + + while read -r line; do + buf="${buf}${line}${LF}" + if [ -f /var/run/syslogd.pid ]; then + printf '%s' "${buf}" | ${logger} + exec ${logger} + fi + done +} + level=${0#*/rc} case ${level} in S) @@ -29,4 +47,4 @@ esac for i in /etc/rc.d/${level}[2-9]*; do [ -x "${i}" ] && "${i}" ${action} 2>&1 done -} | ${logger} +} | log |