summaryrefslogtreecommitdiff
path: root/system/syslog-ng/rc.syslog-ng
diff options
context:
space:
mode:
authorMario Preksavec <mario@slackware.hr>2016-09-28 22:28:40 +0200
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-10-01 07:29:19 +0700
commit7500b1bbf47a2951f0b0fd87c6070961eeb331dc (patch)
treee6e0716b2f98831065f2b2879775fd2df4a189e4 /system/syslog-ng/rc.syslog-ng
parent2c63e36ab3441a96256fe4d8769523c748eba407 (diff)
downloadslackbuilds-7500b1bbf47a2951f0b0fd87c6070961eeb331dc.tar.gz
system/syslog-ng: Updated for version 3.8.1.
Signed-off-by: Mario Preksavec <mario@slackware.hr>
Diffstat (limited to 'system/syslog-ng/rc.syslog-ng')
-rw-r--r--system/syslog-ng/rc.syslog-ng34
1 files changed, 31 insertions, 3 deletions
diff --git a/system/syslog-ng/rc.syslog-ng b/system/syslog-ng/rc.syslog-ng
index 61f4a2beee..d386665cb6 100644
--- a/system/syslog-ng/rc.syslog-ng
+++ b/system/syslog-ng/rc.syslog-ng
@@ -2,12 +2,13 @@
#
# Start/stop/restart the syslog-ng daemon
# Drop-in replacement for a stock Slackware rc.syslog script
-# Written by Mario Preksavec <mario@slackware.hr>
+# Written by Mario Preksavec <mario at slackware dot hr>
+# Updated by Janos Szigetvari <jszigetvari at gmail dot com>
syslog_start() {
if [ -x /usr/sbin/syslog-ng ]; then
if [ -f /var/run/syslog-ng.pid ] && kill -0 $(cat /var/run/syslog-ng.pid) 2> /dev/null; then
- echo "syslog-ng daemon already running!"
+ echo "syslog-ng daemon already running!" >&2
return
fi
@@ -37,6 +38,24 @@ syslog_restart() {
syslog_start
}
+syslog_reload() {
+ if [ -f /var/run/syslog-ng.pid ] && kill -0 $(cat /var/run/syslog-ng.pid) 2> /dev/null; then
+ /usr/sbin/syslog-ng-ctl reload
+ else
+ echo "syslog-ng daemon is not running!" >&2
+ fi
+}
+
+syslog_debug() {
+ if [ -f /var/run/syslog-ng.pid ] && kill -0 $(cat /var/run/syslog-ng.pid) 2> /dev/null; then
+ /usr/sbin/syslog-ng-ctl verbose --set="$1"
+ /usr/sbin/syslog-ng-ctl debug --set="$1"
+ /usr/sbin/syslog-ng-ctl trace --set="$1"
+ else
+ echo "syslog-ng daemon is not running!" >&2
+ fi
+}
+
case "$1" in
'start')
syslog_start
@@ -47,7 +66,16 @@ case "$1" in
'restart')
syslog_restart
;;
+'reload')
+ syslog_reload
+ ;;
+'enable-debug')
+ syslog_debug on
+ ;;
+'disable-debug')
+ syslog_debug off
+ ;;
*)
- echo "usage $0 start|stop|restart"
+ echo "usage $0 start|stop|reload|restart|enable-debug|disable-debug"
esac