![Chris Packham](/assets/img/avatar_default.png)
syslog-ng is an enhanced log daemon, supporting a wide range of input and output methods: syslog, unstructured text, queueing, SQL & NoSQL. [Thomas: - Rewrap Config.in.help text - Pass --pidfile option when starting syslog-ng so that its PID file is created in /var/run/syslog-ng.pid, which allows start-stop-daemon to actually stop syslog-ng. Without this, S01logging was not able to stop syslog-ng. - Pass the executable path at stop time in S01logging, so that start-stop-daemon can check we're not incorrectly stopping something completely different. - Add busybox as a dependency of syslog-ng if busybox is enabled, since we want to override Busybox's S01logging init script. - Simplify the python condition, since python and python3 are mutually exclusive. - Rewrap the comment above SYSLOG_NG_FIXUP_CONFIG.] Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
39 lines
573 B
Bash
39 lines
573 B
Bash
#!/bin/sh
|
|
|
|
start() {
|
|
printf "Starting syslog-ng daemon: "
|
|
start-stop-daemon -S -q -p /var/run/syslog-ng.pid \
|
|
-x /usr/sbin/syslog-ng -- --pidfile /var/run/syslog-ng.pid
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
stop() {
|
|
printf "Stopping syslog-ng daemon: "
|
|
start-stop-daemon -K -q -p /var/run/syslog-ng.pid \
|
|
-x /usr/sbin/syslog-ng
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
sleep 1
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|