summaryrefslogtreecommitdiff
path: root/slackware
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-03-29 12:14:24 +0100
committerMichael Biebl <biebl@debian.org>2008-03-29 12:14:24 +0100
commitea79ad8dae160f0d0966b5a02fa3b73f0c3d1940 (patch)
tree564de6e12a302f99754c7c8490b6dccd1292e70f /slackware
downloadrsyslog-ea79ad8dae160f0d0966b5a02fa3b73f0c3d1940.tar.gz
Imported Upstream version 1.18.2upstream/1.18.2
Diffstat (limited to 'slackware')
-rwxr-xr-xslackware/rc.rsyslogd68
1 files changed, 68 insertions, 0 deletions
diff --git a/slackware/rc.rsyslogd b/slackware/rc.rsyslogd
new file mode 100755
index 0000000..10a2791
--- /dev/null
+++ b/slackware/rc.rsyslogd
@@ -0,0 +1,68 @@
+#!/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
+#
+
+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 -a -x /usr/sbin/klogd ]; then
+ echo "Starting rsyslogd / klogd daemons: "
+# this one listens on the "usual" socket /dev/log
+ echo "/usr/sbin/rsyslogd -i $pidfile1"
+ /usr/sbin/rsyslogd -i "$pidfile1"
+# this one listens only to the UDP port
+ sleep 1
+ echo "/usr/sbin/rsyslogd -o -r 0 -f $confile2 -i $pidfile2"
+ /usr/sbin/rsyslogd -o -r 0 -f "$confile2" -i "$pidfile2"
+ sleep 1 # prevent syslogd/klogd race condition on SMP kernels
+ echo "/usr/sbin/klogd -c 3 -x"
+ # '-c 3' = display level 'error' or higher messages on console
+ # '-x' = turn off broken EIP translation
+ /usr/sbin/klogd -c 3 -x
+ fi
+}
+
+rsyslogd_stop() {
+ killall rsyslogd 2> /dev/null
+ killall klogd 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
+}
+
+confile1=/etc/rsyslog.conf
+pidfile1=/var/run/rsyslogd.pid
+
+confile2=/etc/rsyslog.udp.conf
+pidfile2=/var/run/rsyslogd.udp.pid
+
+case "$1" in
+'start')
+ create_xconsole
+ rsyslogd_start
+ ;;
+'stop')
+ rsyslogd_stop
+ ;;
+'restart')
+ rsyslogd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac