diff options
author | Christophe Trussardi <chris@teria.org> | 2011-12-11 13:19:47 -0600 |
---|---|---|
committer | Niels Horn <niels.horn@slackbuilds.org> | 2011-12-18 00:07:45 -0200 |
commit | c7dedc98824f1aec760ef542e39f2289cb469f9c (patch) | |
tree | bd100e2f170de3448d61e051b21fb58ddac22c3f /system/rsyslog/config/rc.rsyslogd | |
parent | a13590db46cdd8b1f3c6cb1fb0e58ef6850c9a8b (diff) |
system/rsyslog: Added (enhanced syslogd)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/rsyslog/config/rc.rsyslogd')
-rw-r--r-- | system/rsyslog/config/rc.rsyslogd | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/system/rsyslog/config/rc.rsyslogd b/system/rsyslog/config/rc.rsyslogd new file mode 100644 index 0000000000000..f12c369168f8d --- /dev/null +++ b/system/rsyslog/config/rc.rsyslogd @@ -0,0 +1,65 @@ +#!/bin/sh +# Start/stop/restart the system logging daemons. +# +# Written for Slackware Linux by Patrick J. Volkerding <volkerdi@slackware.com>. +# Modded for rsyslogd by Chris Elvidge <chris@lowe.ae> Sept 2005 +# slightly modified by ponce <matteo.bernardini@sns.it> Oct 2010 +# rsyslogd_reload added by Christophe Trussardi <chris@teria.org> Sept 2011 +# + +pidfile1=/var/run/rsyslogd.pid # native rsyslogd pid file +pidfile2=/var/run/syslogd.pid # spoof the "old" syslogd file + +create_xconsole() +{ + if [ ! -e /dev/xconsole ]; then + mknod -m 640 /dev/xconsole p + else + chmod 0640 /dev/xconsole + fi + chown 0:0 /dev/xconsole +} + +rsyslogd_start() { + if [ -x /usr/sbin/rsyslogd ]; then + echo "Starting rsyslogd daemon: " + echo "/usr/sbin/rsyslogd -c5 -i $pidfile1" + /usr/sbin/rsyslogd -c5 -i "$pidfile1" + cp "$pidfile1" "$pidfile2" + fi +} + +rsyslogd_stop() { + killall rsyslogd 2> /dev/null + /usr/bin/rm $pidfile1 2> /dev/null + /usr/bin/rm $pidfile2 2> /dev/null +} + +rsyslogd_restart() { + rsyslogd_stop + sleep 1 + rsyslogd_start +} + +rsyslogd_reload() { + echo "Reloading rsyslogd daemon: " + [ -f "$pidfile1" ] && /bin/kill -HUP $(cat $pidfile1) +} + +case "$1" in +'start') + create_xconsole + rsyslogd_start + ;; +'stop') + rsyslogd_stop + ;; +'restart') + rsyslogd_restart + ;; +'reload') + rsyslogd_reload + ;; +*) + echo "usage $0 start|stop|restart|reload" +esac |