36 lines
833 B
Bash
36 lines
833 B
Bash
#!/bin/sh
|
|
#
|
|
# logrotate - launches logrotate at boot time to ensure logs are rotated on machine that are
|
|
# usually not up when the cron job would be executed
|
|
#
|
|
# chkconfig: 2345 99 01
|
|
# description: launches logrotate at boot time to ensure logs are rotated on machine that are
|
|
# usually not up when the cron job would be executed
|
|
#
|
|
. /etc/sysconfig/rc
|
|
. $rc_functions
|
|
|
|
NAME=logrotate
|
|
DAEMON=/usr/sbin/$NAME
|
|
DAEMONPID=/var/run/$NAME.pid
|
|
DAEMONLOCK=/var/lock/subsys/$NAME
|
|
OPTIONS=/etc/logrotate.conf
|
|
|
|
[ -x $DAEMON ] || exit 0
|
|
|
|
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n $"Starting"" $NAME: "
|
|
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS
|
|
echo
|
|
;;
|
|
stop)
|
|
;;
|
|
*)
|
|
echo $"Usage: ""/etc/init.d/$NAME {start}"
|
|
exit 1
|
|
;;
|
|
esac
|