Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
#
3
# htcacheclean     Startup script for the htcacheclean
4
#
5
# chkconfig: - 85 15
6
# description:  Htcacheclean is used to keep the size of \
7
#	        mod_cache_disk's storage within a given size limit.
8
# processname: htcacheclean
9
# config: /etc/sysconfig/htcacheclean
10
# pidfile: /var/run/htcacheclean/htcacheclean.pid
11
#
12
### BEGIN INIT INFO
13
# Provides: htcacheclean
14
# Required-Start: $local_fs $remote_fs $named
15
# Required-Stop: $local_fs $remote_fs
16
# Short-Description: start and stop htcacheclean
17
# Description:  Htcacheclean is used to keep the size of \
18
#  mod_cache_disk's storage within a given size limit.
19
### END INIT INFO
20
 
21
# Source function library.
22
. /etc/rc.d/init.d/functions
23
 
24
# INTERVAL, CACHE_ROOT and CACHE_LIMIT can be set
25
# in /etc/sysconfig/htcacheclean configuration file.
26
if [ -f /etc/sysconfig/htcacheclean ]; then
27
        . /etc/sysconfig/htcacheclean
28
fi
29
 
30
# Path to the htcacheclean binary.
31
binary=/usr/sbin/htcacheclean
32
prog=htcacheclean
33
#pidfile=${PIDFILE-/var/run/htcacheclean/htcacheclean.pid}
34
lockfile=${LOCKFILE-/var/lock/subsys/htcacheclean}
35
interval=${INTERVAL-5}
36
cache_path=${CACHE_ROOT-/var/cache/mod_proxy}
37
cache_limit=${CACHE_LIMIT-150M}
38
RETVAL=0
39
 
40
start() {
41
        [ "$EUID" != "0" ] && exit 4
42
        echo -n $"Starting $prog: "
43
        daemon $binary -d${interval} -n -i -p${cache_path} -l${cache_limit} $OPTIONS
44
        RETVAL=$?
45
        echo
46
        [ $RETVAL = 0 ] && touch ${lockfile}
47
        return $RETVAL
48
}
49
 
50
stop() {
51
	[ "$EUID" != "0" ] && exit 4
52
	echo -n $"Stopping $prog: "
53
	killproc $binary
54
	RETVAL=$?
55
	echo
56
	[ $RETVAL = 0 ] && rm -f ${lockfile}
57
}
58
 
59
# See how we were called.
60
case "$1" in
61
  start)
62
	start
63
	;;
64
  stop)
65
	stop
66
	;;
67
  status)
68
        status $binary
69
	RETVAL=$?
70
	;;
71
  restart)
72
	stop
73
	start
74
	;;
75
  condrestart|try-restart)
76
	if status $binary >&/dev/null; then
77
		stop
78
		start
79
	fi
80
	;;
81
  force-reload|reload)
82
        exit 3
83
	;;
84
  *)
85
	echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|status|help}"
86
	RETVAL=2
87
esac
88
 
89
exit $RETVAL