From: Gustavo Zacarias Date: Tue, 13 Jan 2015 23:16:59 +0000 (-0300) Subject: rsyslog: clean up sysv initscript X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ffa7389af80bd99e5930c0cf2556f47dcb0793a;p=buildroot.git rsyslog: clean up sysv initscript Fix indentation, remove redundant comment, print real start/stop status. Signed-off-by: Gustavo Zacarias Signed-off-by: Thomas Petazzoni --- diff --git a/package/rsyslog/S01logging b/package/rsyslog/S01logging index 0c4bbc7325..97d519a257 100644 --- a/package/rsyslog/S01logging +++ b/package/rsyslog/S01logging @@ -1,38 +1,37 @@ #!/bin/sh -# -# Starts rsyslog. -# start() { - echo -n "Starting rsyslog daemon: " - umask 077 - start-stop-daemon -S -q -p /var/run/rsyslogd.pid --exec /usr/sbin/rsyslogd - echo "OK" + echo -n "Starting rsyslog daemon: " + umask 077 + start-stop-daemon -S -q -p /var/run/rsyslogd.pid --exec /usr/sbin/rsyslogd + [ $? = 0 ] && echo "OK" || echo "FAIL" } + stop() { - echo -n "Stopping rsyslog daemon: " - start-stop-daemon -K -q -p /var/run/rsyslogd.pid - echo "OK" + echo -n "Stopping rsyslog daemon: " + start-stop-daemon -K -q -p /var/run/rsyslogd.pid + [ $? = 0 ] && echo "OK" || echo "FAIL" } + restart() { - stop - start + stop + sleep 1 + start } case "$1" in start) - start - ;; + start + ;; stop) - stop - ;; + stop + ;; restart|reload) - restart - ;; + restart + ;; *) - echo "Usage: $0 {start|stop|restart}" - exit 1 + echo "Usage: $0 {start|stop|restart}" + exit 1 esac exit $? -