Merge lp:~trond-norbye/drizzle/memcached-startup into lp:~drizzle-trunk/drizzle/development

Proposed by Trond Norbye
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trond-norbye/drizzle/memcached-startup
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 152 lines (+55/-55)
5 files modified
.bzrignore (+1/-0)
plugin/memcached_functions/plugin.ac (+1/-0)
plugin/memcached_functions/tests/start_mc.sh (+0/-52)
plugin/memcached_functions/tests/start_mc.sh.in (+50/-0)
plugin/memcached_functions/tests/t/memc.test (+3/-3)
To merge this branch: bzr merge lp:~trond-norbye/drizzle/memcached-startup
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+16276@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Trond Norbye (trond-norbye) wrote :

Fix the startup script for the memcached server to run the binary we detected during configure

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-12-05 00:32:01 +0000
+++ .bzrignore 2009-12-17 11:06:14 +0000
@@ -109,6 +109,7 @@
109plugin/archive/archive_reader109plugin/archive/archive_reader
110plugin/archive/archive_test110plugin/archive/archive_test
111plugin/archive/concurrency_test111plugin/archive/concurrency_test
112plugin/memcached_functions/tests/start_mc.sh
112plugin/myisam/myisamchk113plugin/myisam/myisamchk
113plugin/myisam/myisamlog114plugin/myisam/myisamlog
114plugin/myisam/myisampack115plugin/myisam/myisampack
115116
=== modified file 'plugin/memcached_functions/plugin.ac'
--- plugin/memcached_functions/plugin.ac 2009-11-21 01:47:03 +0000
+++ plugin/memcached_functions/plugin.ac 2009-12-17 11:06:14 +0000
@@ -3,3 +3,4 @@
3AS_IF([test "x$ac_cv_libmemcached" = "xno" -a "x${MEMCACHED_BINARY}" = "xyes"],3AS_IF([test "x$ac_cv_libmemcached" = "xno" -a "x${MEMCACHED_BINARY}" = "xyes"],
4 AC_MSG_WARN([libmemcached not found: not building memcached_functions plugin.]))4 AC_MSG_WARN([libmemcached not found: not building memcached_functions plugin.]))
5DRIZZLED_PLUGIN_DEP_LIBS="${DRIZZLED_PLUGIN_DEP_LIBS} ${LTLIBMEMCACHED}"5DRIZZLED_PLUGIN_DEP_LIBS="${DRIZZLED_PLUGIN_DEP_LIBS} ${LTLIBMEMCACHED}"
6AC_CONFIG_FILES([plugin/memcached_functions/tests/start_mc.sh])
67
=== removed file 'plugin/memcached_functions/tests/start_mc.sh'
--- plugin/memcached_functions/tests/start_mc.sh 2009-10-16 21:01:42 +0000
+++ plugin/memcached_functions/tests/start_mc.sh 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1#! /bin/sh
2
3PORT=19191
4if [ $MC_PORT ]; then
5 PORT=$MC_PORT
6fi
7
8USER=nobody
9MAXCONN=1024
10CACHESIZE=1024
11OPTIONS=""
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH
14RETVAL=0
15
16start () {
17 memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -U 0
18 RETVAL=$?
19}
20stop () {
21 PIDS=`ps -ef | grep memcached | grep $PORT | grep $USER | grep -v grep | awk '{print $2}'`
22 if test "x${PIDS}" != "x"
23 then
24 echo "${PIDS}" | xargs -n1 kill -9
25 RETVAL=$?
26 fi
27}
28
29restart () {
30 stop
31 start
32}
33
34
35# See how we were called.
36case "$1" in
37 start)
38 start
39 ;;
40 stop)
41 stop
42 ;;
43 restart|reload)
44 restart
45 ;;
46 *)
47 echo $"Usage: $0 {start|stop|restart|reload}"
48 exit 1
49esac
50
51exit $?
52
530
=== added file 'plugin/memcached_functions/tests/start_mc.sh.in'
--- plugin/memcached_functions/tests/start_mc.sh.in 1970-01-01 00:00:00 +0000
+++ plugin/memcached_functions/tests/start_mc.sh.in 2009-12-17 11:06:14 +0000
@@ -0,0 +1,50 @@
1#! /bin/sh
2
3PORT=19191
4if [ $MC_PORT ]; then
5 PORT=$MC_PORT
6fi
7
8MAXCONN=1024
9CACHESIZE=1024
10OPTIONS=""
11
12startup()
13{
14 @MEMCACHED_BINARY@ -d -p $PORT -m $CACHESIZE -c $MAXCONN -U 0 -P /tmp/memc.pid.$PORT
15}
16
17shutdown()
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
26restart()
27{
28 shutdown
29 startup
30}
31
32
33# See how we were called.
34case "$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
47esac
48
49exit $?
50
051
=== modified file 'plugin/memcached_functions/tests/t/memc.test'
--- plugin/memcached_functions/tests/t/memc.test 2009-12-04 18:50:04 +0000
+++ plugin/memcached_functions/tests/t/memc.test 2009-12-17 11:06:14 +0000
@@ -1,7 +1,7 @@
1# we are assuming the memcached binary is contained in PATH or1# we are assuming the memcached binary is contained in PATH or
2# common directories we might expect it to be in2# common directories we might expect it to be in
3--exec $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh stop3--exec sh $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh stop
4--exec $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh start4--exec sh $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh start
55
6DROP TABLE IF EXISTS `t1`;6DROP TABLE IF EXISTS `t1`;
7--replace_result $MC_PORT MC_A_PORT7--replace_result $MC_PORT MC_A_PORT
@@ -193,5 +193,5 @@
193select memc_behavior_get('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK');193select memc_behavior_get('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK');
194select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK', @size);194select memc_behavior_set('MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK', @size);
195195
196--exec $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh stop196--exec sh $DRIZZLE_TEST_DIR/../plugin/memcached_functions/tests/start_mc.sh stop
197197