~mordred/ubuntu/maverick/drizzle/prerelease

« back to all changes in this revision

Viewing changes to plugin/memcached_query_cache/start_mc.sh

  • Committer: Monty Taylor
  • Date: 2010-09-26 16:09:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1383.
  • Revision ID: mordred@inaugust.com-20100926160902-r30v5hegk16cjk22
Tags: upstream-2010.09.1794
ImportĀ upstreamĀ versionĀ 2010.09.1794

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
PORT=19191
 
4
if [ $MC_PORT ]; then
 
5
  PORT=$MC_PORT
 
6
fi
 
7
 
 
8
MAXCONN=1024
 
9
CACHESIZE=1024
 
10
OPTIONS=""
 
11
 
 
12
startup()
 
13
{
 
14
  memcached -d -p $PORT -m $CACHESIZE -c $MAXCONN -U 0 -P /tmp/memc.pid.$PORT
 
15
}
 
16
 
 
17
shutdown()
 
18
{
 
19
  if [ -f /tmp/memc.pid.$PORT ]
 
20
  then
 
21
    kill -9 `cat /tmp/memc.pid.$PORT`
 
22
    rm /tmp/memc.pid.$PORT
 
23
  fi
 
24
}
 
25
 
 
26
restart()
 
27
{
 
28
  shutdown
 
29
  startup
 
30
}
 
31
 
 
32
 
 
33
# See how we were called.
 
34
case "$1" in
 
35
  start)
 
36
        startup
 
37
        ;;
 
38
  stop)
 
39
        shutdown
 
40
        ;;
 
41
  restart|reload)
 
42
        restart
 
43
        ;;
 
44
  *)
 
45
        echo $"Usage: $0 {start|stop|restart|reload}"
 
46
        exit 1
 
47
esac
 
48
 
 
49
exit $?
 
50