~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/suite/memcached_functions/start_mc.sh

  • Committer: Patrick Galbraith
  • Date: 2009-10-08 22:42:05 UTC
  • mto: (1166.5.3 memcached_functions)
  • mto: This revision was merged to the branch mainline in revision 1189.
  • Revision ID: patg@patrick-galbraiths-macbook-pro.local-20091008224205-gq1pehjsivvx0qo9
Starting over with a fresh tree, moved in memcached functions.

Memcached Functions for Drizzle. 

All tests pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
PORT=19191
 
4
if [ $MC_PORT ]; then
 
5
  PORT=$MC_PORT
 
6
fi
 
7
 
 
8
USER=nobody
 
9
MAXCONN=1024
 
10
CACHESIZE=1024
 
11
OPTIONS=""
 
12
 
 
13
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH
 
14
RETVAL=0
 
15
 
 
16
start () {
 
17
        memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -U 0
 
18
        RETVAL=$?
 
19
}
 
20
stop () {
 
21
        kill -9 `ps -ef | grep memcached | grep $PORT | grep $USER | grep -v grep | awk '{print $2}'`
 
22
        RETVAL=$?
 
23
}
 
24
 
 
25
restart () {
 
26
        stop
 
27
        start
 
28
}
 
29
 
 
30
 
 
31
# See how we were called.
 
32
case "$1" in
 
33
  start)
 
34
        start
 
35
        ;;
 
36
  stop)
 
37
        stop
 
38
        ;;
 
39
  restart|reload)
 
40
        restart
 
41
        ;;
 
42
  *)
 
43
        echo $"Usage: $0 {start|stop|restart|reload}"
 
44
        exit 1
 
45
esac
 
46
 
 
47
exit $?
 
48