1643.6.13
by Djellel E. Difallah
adding tests |
1 |
#!/usr/bin/env bash
|
1971.2.1
by kalebral at gmail
update files that did not have license or had incorrect license structure |
2 |
#
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
3 |
# Copyright (C) 2010 Djellel E. Difallah <ded@ubuntu>
|
1971.2.1
by kalebral at gmail
update files that did not have license or had incorrect license structure |
4 |
# All rights reserved.
|
5 |
#
|
|
6 |
# Redistribution and use in source and binary forms, with or without
|
|
7 |
# modification, are permitted provided that the following conditions are
|
|
8 |
# met:
|
|
9 |
#
|
|
10 |
# * Redistributions of source code must retain the above copyright
|
|
11 |
# notice, this list of conditions and the following disclaimer.
|
|
12 |
#
|
|
13 |
# * Redistributions in binary form must reproduce the above
|
|
14 |
# copyright notice, this list of conditions and the following disclaimer
|
|
15 |
# in the documentation and/or other materials provided with the
|
|
16 |
# distribution.
|
|
17 |
#
|
|
18 |
# * The names of its contributors may not be used to endorse or
|
|
19 |
# promote products derived from this software without specific prior
|
|
20 |
# written permission.
|
|
21 |
#
|
|
22 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23 |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24 |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25 |
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26 |
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29 |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30 |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31 |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33 |
#
|
|
1643.6.13
by Djellel E. Difallah
adding tests |
34 |
|
35 |
PORT=19191 |
|
36 |
if [ $MC_PORT ]; then |
|
37 |
PORT=$MC_PORT |
|
38 |
fi
|
|
39 |
||
40 |
MAXCONN=1024 |
|
41 |
CACHESIZE=1024 |
|
42 |
OPTIONS="" |
|
43 |
||
44 |
startup()
|
|
45 |
{
|
|
46 |
memcached -d -p $PORT -m $CACHESIZE -c $MAXCONN -U 0 -P /tmp/memc.pid.$PORT |
|
47 |
}
|
|
48 |
||
49 |
shutdown()
|
|
50 |
{
|
|
51 |
if [ -f /tmp/memc.pid.$PORT ] |
|
52 |
then
|
|
53 |
kill -9 `cat /tmp/memc.pid.$PORT` |
|
54 |
rm /tmp/memc.pid.$PORT
|
|
55 |
fi
|
|
56 |
}
|
|
57 |
||
58 |
restart()
|
|
59 |
{
|
|
60 |
shutdown |
|
61 |
startup |
|
62 |
}
|
|
63 |
||
64 |
||
65 |
# See how we were called.
|
|
66 |
case "$1" in |
|
67 |
start)
|
|
68 |
startup |
|
69 |
;;
|
|
70 |
stop)
|
|
71 |
shutdown |
|
72 |
;;
|
|
73 |
restart|reload) |
|
74 |
restart |
|
75 |
;;
|
|
76 |
*)
|
|
77 |
echo $"Usage: $0 {start|stop|restart|reload}" |
|
78 |
exit 1 |
|
79 |
esac
|
|
80 |
||
81 |
exit $? |
|
82 |