aboutsummaryrefslogtreecommitdiff
path: root/package/rsyslog/S01logging
diff options
context:
space:
mode:
authorGravatar Gustavo Zacarias <gustavo@zacarias.com.ar>2015-01-13 20:16:59 -0300
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-01-14 20:26:43 +0100
commit7ffa7389af80bd99e5930c0cf2556f47dcb0793a (patch)
treef625cf583c9a5250a00c8a3c5a84fd1387930f95 /package/rsyslog/S01logging
parent3f74996c1e168f5ab910033e5f7f3039e3831d58 (diff)
downloadbuildroot-7ffa7389af80bd99e5930c0cf2556f47dcb0793a.tar.gz
buildroot-7ffa7389af80bd99e5930c0cf2556f47dcb0793a.tar.bz2
rsyslog: clean up sysv initscript
Fix indentation, remove redundant comment, print real start/stop status. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/rsyslog/S01logging')
-rw-r--r--package/rsyslog/S01logging41
1 files changed, 20 insertions, 21 deletions
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 $?
-