sysklogd: improved rc script
This commit is contained in:
parent
fbcb7ac028
commit
b8894cebe1
@ -1,5 +1,5 @@
|
|||||||
41dfad9077311e159c793216adf90723 rotatelog
|
41dfad9077311e159c793216adf90723 rotatelog
|
||||||
a1bb71ed6b0ce791cb7f9fa0089a09ef sysklogd
|
b34c927b05f072083d801deba5420e80 sysklogd
|
||||||
c70599ab0d037fde724f7210c2c8d7f8 sysklogd-1.5.1.tar.gz
|
c70599ab0d037fde724f7210c2c8d7f8 sysklogd-1.5.1.tar.gz
|
||||||
844e5e75944beb8cf4f39a0535e56ba4 syslog
|
844e5e75944beb8cf4f39a0535e56ba4 syslog
|
||||||
f8d478b8d60c1d3879f4a10a955db6e5 syslog.conf
|
f8d478b8d60c1d3879f4a10a955db6e5 syslog.conf
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
name=sysklogd
|
name=sysklogd
|
||||||
version=1.5.1
|
version=1.5.1
|
||||||
release=1
|
release=2
|
||||||
source=(http://www.infodrom.org/projects/$name/download/$name-$version.tar.gz \
|
source=(http://www.infodrom.org/projects/$name/download/$name-$version.tar.gz \
|
||||||
rotatelog syslog syslog.conf sysklogd)
|
rotatelog syslog syslog.conf sysklogd)
|
||||||
|
|
||||||
|
@ -1,23 +1,45 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# /etc/rc.d/sysklogd: start/stop sysklogd logging daemons
|
# /etc/rc.d/sysklogd: start/stop syslog and klog daemons
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SSD=/sbin/start-stop-daemon
|
||||||
|
SLOG=/usr/sbin/syslogd
|
||||||
|
KLOG=/usr/sbin/klogd
|
||||||
|
SLOG_PID=/var/run/syslogd.pid
|
||||||
|
KLOG_PID=/var/run/klogd.pid
|
||||||
|
|
||||||
|
|
||||||
|
print_status() {
|
||||||
|
$SSD --status --pidfile $2
|
||||||
|
case $? in
|
||||||
|
0) echo "$1 is running with pid $(cat $2)" ;;
|
||||||
|
1) echo "$1 is not running but the pid file $2 exists" ;;
|
||||||
|
3) echo "$1 is not running" ;;
|
||||||
|
4) echo "Unable to determine the program status" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
start)
|
start)
|
||||||
/usr/sbin/syslogd
|
$SSD --start --pidfile $SLOG_PID --exec $SLOG
|
||||||
/usr/sbin/klogd -c 4
|
$SSD --start --pidfile $KLOG_PID --exec $KLOG -- -c4
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
/usr/bin/killall syslogd
|
$SSD --stop --retry 10 --pidfile $SLOG_PID
|
||||||
/usr/bin/killall klogd
|
$SSD --stop --retry 10 --pidfile $KLOG_PID
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
sleep 2
|
|
||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
|
status)
|
||||||
|
print_status $SLOG $SLOG_PID
|
||||||
|
print_status $KLOG $KLOG_PID
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "usage: $0 [start|stop|restart]"
|
echo "usage: $0 [start|stop|restart|status]"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# End of file
|
||||||
|
Loading…
Reference in New Issue
Block a user