Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 91 lines (77 sloc) 1.586 kB
ae82a07 @remicollet impot memcached 1.4.5-1
authored
1 #! /bin/sh
2 #
3 # chkconfig: - 55 45
4 # description: The memcached daemon is a network memory cache service.
5 # processname: memcached
6 # config: /etc/sysconfig/memcached
40a82ef @remicollet also use /var/run/memcached/memcached.pid on EL-4
authored
7 # pidfile: /var/run/memcached/memcached.pid
ae82a07 @remicollet impot memcached 1.4.5-1
authored
8
9 # Standard LSB functions
10 #. /lib/lsb/init-functions
11
12 # Source function library.
13 . /etc/init.d/functions
14
15 PORT=11211
16 USER=memcached
17 MAXCONN=1024
18 CACHESIZE=64
19 OPTIONS=""
20
21 if [ -f /etc/sysconfig/memcached ];then
22 . /etc/sysconfig/memcached
23 fi
24
25 # Check that networking is up.
26 . /etc/sysconfig/network
27
28 if [ "$NETWORKING" = "no" ]
29 then
30 exit 0
31 fi
32
33 RETVAL=0
34 prog="memcached"
40a82ef @remicollet also use /var/run/memcached/memcached.pid on EL-4
authored
35 pidfile=${PIDFILE-/var/run/memcached/memcached.pid}
f7d8e0e @remicollet sync with rawhide
authored
36 lockfile=${LOCKFILE-/var/lock/subsys/memcached}
ae82a07 @remicollet impot memcached 1.4.5-1
authored
37
38 start () {
39 echo -n $"Starting $prog: "
40a82ef @remicollet also use /var/run/memcached/memcached.pid on EL-4
authored
40 # Ensure that /var/run/memcached has proper permissions
41 if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then
42 chown $USER /var/run/memcached
43 fi
44
f7d8e0e @remicollet sync with rawhide
authored
45 daemon memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS
ae82a07 @remicollet impot memcached 1.4.5-1
authored
46 RETVAL=$?
47 echo
f7d8e0e @remicollet sync with rawhide
authored
48 [ $RETVAL -eq 0 ] && touch ${lockfile}
ae82a07 @remicollet impot memcached 1.4.5-1
authored
49 }
50 stop () {
51 echo -n $"Stopping $prog: "
f7d8e0e @remicollet sync with rawhide
authored
52 killproc /usr/bin/memcached
ae82a07 @remicollet impot memcached 1.4.5-1
authored
53 RETVAL=$?
54 echo
55 if [ $RETVAL -eq 0 ] ; then
f7d8e0e @remicollet sync with rawhide
authored
56 rm -f ${lockfile} ${pidfile}
ae82a07 @remicollet impot memcached 1.4.5-1
authored
57 fi
58 }
59
60 restart () {
61 stop
62 start
63 }
64
65
66 # See how we were called.
67 case "$1" in
68 start)
69 start
70 ;;
71 stop)
72 stop
73 ;;
74 status)
75 status memcached
f7d8e0e @remicollet sync with rawhide
authored
76 RETVAL=$?
ae82a07 @remicollet impot memcached 1.4.5-1
authored
77 ;;
78 restart|reload|force-reload)
79 restart
80 ;;
f7d8e0e @remicollet sync with rawhide
authored
81 condrestart|try-restart)
82 [ -f ${lockfile} ] && restart || :
ae82a07 @remicollet impot memcached 1.4.5-1
authored
83 ;;
84 *)
f7d8e0e @remicollet sync with rawhide
authored
85 echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
86 RETVAL=2
87 ;;
ae82a07 @remicollet impot memcached 1.4.5-1
authored
88 esac
89
f7d8e0e @remicollet sync with rawhide
authored
90 exit $RETVAL
Something went wrong with that request. Please try again.