summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-08-08 16:18:21 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-08-08 16:18:21 +0000
commit9e12167740b6ce46487c7bb5c5554b5c807d2431 (patch)
treec8d82cc5a66c55c45ddaf0fb2afabfe37f1f8e57 /debian
parent6d8ebae225ad55a175b2266f531e0ddba50da706 (diff)
downloadrsyslog-9e12167740b6ce46487c7bb5c5554b5c807d2431.tar.gz
rsyslog-9e12167740b6ce46487c7bb5c5554b5c807d2431.tar.xz
rsyslog-9e12167740b6ce46487c7bb5c5554b5c807d2431.zip
startup script for debian added
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/rsyslogd95
1 files changed, 95 insertions, 0 deletions
diff --git a/debian/rsyslogd b/debian/rsyslogd
new file mode 100755
index 00000000..3218c500
--- /dev/null
+++ b/debian/rsyslogd
@@ -0,0 +1,95 @@
+#! /bin/sh
+# /etc/init.d/rsyslogd: start the rsyslogd system log daemon.
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile=/var/run/rsyslogd.pid
+binpath=/usr/sbin/rsyslogd
+
+test -x $binpath || exit 0
+
+# Options for start/restart the daemons
+# For remote UDP logging use SYSLOGD="-r 0"
+# "-t 1470" is a TCP listener on port 1470 (PIX)
+# For relaying add "-h" to SYSLOGD
+#
+SYSLOGD="-r 0 -h -t 1470"
+
+create_xconsole()
+{
+ if [ ! -e /dev/xconsole ]; then
+ mknod -m 640 /dev/xconsole p
+ else
+ chmod 0640 /dev/xconsole
+ fi
+ chown root.adm /dev/xconsole
+}
+
+running()
+{
+ # No pidfile, probably no daemon present
+ #
+ if [ ! -f $pidfile ]
+ then
+ return 1
+ fi
+
+ pid=`cat $pidfile`
+
+ # No pid, probably no daemon present
+ #
+ if [ -z "$pid" ]
+ then
+ return 1
+ fi
+
+ cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -1`
+
+ # No syslogd?
+ #
+ if [ "$cmd" != "$binpath" ]
+ then
+ return 1
+ fi
+
+ return 0
+}
+
+case "$1" in
+ start)
+ echo -n "Starting system log daemon: rsyslogd"
+ create_xconsole
+ start-stop-daemon --start --quiet --exec $binpath -- $SYSLOGD
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping system log daemon: rsyslogd"
+ start-stop-daemon --stop --exec $binpath --pidfile $pidfile
+ echo "."
+ ;;
+ reload|force-reload)
+ start-stop-daemon --stop --quiet --signal 1 --exec $binpath --pidfile $pidfile
+ ;;
+ restart)
+ echo -n "Stopping system log daemon: rsyslogd"
+ start-stop-daemon --stop --quiet --exec $binpath --pidfile $pidfile
+ echo "."
+ sleep 1
+ echo -n "Starting system log daemon: rsyslogd"
+ start-stop-daemon --start --quiet --exec $binpath -- $SYSLOGD
+ echo "."
+ ;;
+ reload-or-restart)
+ if running
+ then
+ start-stop-daemon --stop --quiet --signal 1 --exec $binpath --pidfile $pidfile
+ else
+ start-stop-daemon --start --quiet --exec $binpath -- $SYSLOGD
+ fi
+ ;;
+ *)
+ echo "Usage: /etc/init.d/rsyslogd {start|stop|reload|restart|force-reload|reload-or-restart}"
+ exit 1
+esac
+
+exit 0