Fix error with logging command in memcached and sqldb start / stop scripts. Adjust test scripts, add new parameter required by memcached start / stop scripts.

git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk@1231821 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/components/cache/memcached-ssl-test b/components/cache/memcached-ssl-test
index ffd1cd0..6a9dc2c 100755
--- a/components/cache/memcached-ssl-test
+++ b/components/cache/memcached-ssl-test
@@ -22,9 +22,9 @@
 ../../modules/http/ssl-cert-conf tmp/ssl localhost server
 ../../modules/http/ssl-cert-conf tmp/ssl localhost tunnel
 
-./memcached-start 11411
-./memcached-start 11412
-./memcached-start 11413
+./memcached-start tmp 11411
+./memcached-start tmp 11412
+./memcached-start tmp 11413
 
 ../../modules/http/httpd-conf tmp/tunnel localhost 8089 htdocs
 ../../modules/http/httpd-event-conf tmp/tunnel
@@ -49,7 +49,7 @@
 # Cleanup
 ../../modules/http/httpd-stop tmp/tunnel
 ../../modules/http/httpd-stop tmp/server
-./memcached-stop 11411
-./memcached-stop 11412
-./memcached-stop 11413
+./memcached-stop tmp 11411
+./memcached-stop tmp 11412
+./memcached-stop tmp 11413
 exit $rc
diff --git a/components/cache/memcached-start b/components/cache/memcached-start
index a49ad29..947b583 100755
--- a/components/cache/memcached-start
+++ b/components/cache/memcached-start
@@ -40,10 +40,12 @@
     log="cat >>$root/logs/memcached"
     v=""
 fi
+mkdir -p $root/memcached
+echo $log > $root/memcached/logger
 
 if [ "$ip" = "" ]; then
-    ($memcached_prefix/bin/memcached -d -m 4 -p $port $v 2>&1 | $log)&
+    ($memcached_prefix/bin/memcached -d -m 4 -p $port $v 2>&1 | sh $root/memcached/logger)&
 else
-    ($memcached_prefix/bin/memcached -d -l $ip -m 4 -p $port $v 2>&1 | $log)&
+    ($memcached_prefix/bin/memcached -d -l $ip -m 4 -p $port $v 2>&1 | sh $root/memcached/logger)&
 fi
 
diff --git a/components/cache/memcached-stop b/components/cache/memcached-stop
index b76fc28..2b3b66c 100755
--- a/components/cache/memcached-stop
+++ b/components/cache/memcached-stop
@@ -19,8 +19,9 @@
 
 # Stop memcached
 here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
 
-addr=$1
+addr=$2
 if [ "$addr" = "" ]; then
     ip=""
     port="11211"
diff --git a/components/cache/memcached-test b/components/cache/memcached-test
index 8e034bb..e647c55 100755
--- a/components/cache/memcached-test
+++ b/components/cache/memcached-test
@@ -18,9 +18,9 @@
 #  under the License.
 
 # Setup
-./memcached-start 11211
-./memcached-start 11212
-./memcached-start 11213
+./memcached-start tmp 11211
+./memcached-start tmp 11212
+./memcached-start tmp 11213
 sleep 1
 
 # Test
@@ -28,7 +28,7 @@
 rc=$?
 
 # Cleanup
-./memcached-stop 11211
-./memcached-stop 11212
-./memcached-stop 11213
+./memcached-stop tmp 11211
+./memcached-stop tmp 11212
+./memcached-stop tmp 11213
 exit $rc
diff --git a/components/cache/server-test b/components/cache/server-test
index d9176f3..bc56b1f 100755
--- a/components/cache/server-test
+++ b/components/cache/server-test
@@ -27,12 +27,12 @@
 SCAComposite cache.composite
 EOF
 
-./memcached-start 11211
-./memcached-start 11212
-./memcached-start 11213
-./memcached-start 11411
-./memcached-start 11412
-./memcached-start 11413
+./memcached-start tmp 11211
+./memcached-start tmp 11212
+./memcached-start tmp 11213
+./memcached-start tmp 11411
+./memcached-start tmp 11412
+./memcached-start tmp 11413
 ../../modules/http/httpd-start tmp
 sleep 2
 
@@ -42,11 +42,11 @@
 
 # Cleanup
 ../../modules/http/httpd-stop tmp
-./memcached-stop 11211
-./memcached-stop 11212
-./memcached-stop 11213
-./memcached-stop 11411
-./memcached-stop 11412
-./memcached-stop 11413
+./memcached-stop tmp 11211
+./memcached-stop tmp 11212
+./memcached-stop tmp 11213
+./memcached-stop tmp 11411
+./memcached-stop tmp 11412
+./memcached-stop tmp 11413
 sleep 2
 exit $rc
diff --git a/components/sqldb/pgsql-backup b/components/sqldb/pgsql-backup
index 3c0be60..c0b1c4b 100755
--- a/components/sqldb/pgsql-backup
+++ b/components/sqldb/pgsql-backup
@@ -37,13 +37,15 @@
     mkdir -p $root/logs
     pgsql_log="cat >>$root/logs/postgresql"
 fi
+mkdir -p $root/sqldb
+echo $pgsql_log >$root/sqldb/logger
 
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 2>&1 | $pgsql_log
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 2>&1 | sh $root/sqldb/logger
 
 echo "Content-type: application/x-compressed"
 echo
 
 tar -C $root/sqldb -cz data
 
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 2>&1 | $pgsql_log
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 2>&1 | sh $root/sqldb/logger
 
diff --git a/components/sqldb/pgsql-conf b/components/sqldb/pgsql-conf
index e3eb1c8..6aa705f 100755
--- a/components/sqldb/pgsql-conf
+++ b/components/sqldb/pgsql-conf
@@ -45,9 +45,11 @@
     mkdir -p $root/logs
     pgsql_log="cat >>$root/logs/postgresql"
 fi
+mkdir -p $root/sqldb
+echo $pgsql_log >$root/sqldb/logger
 
 if [ ! -f $root/sqldb/data/postgresql.conf ]; then
-    $pgsql_prefix/bin/pg_ctl init -D $root/sqldb/data 2>&1 | $pgsql_log
+    $pgsql_prefix/bin/pg_ctl init -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
     cp $root/sqldb/data/postgresql.conf $root/sqldb/data/postgresql-init.conf
     cp $root/sqldb/data/pg_hba.conf $root/sqldb/data/pg_hba-init.conf
 fi
@@ -96,7 +98,7 @@
 EOF
 
 # Create the db
-($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | $pgsql_log)&
+($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
 sti=0
 while [ $sti -ne 30 ]; do
     st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`
@@ -107,8 +109,8 @@
     sti=$((sti+1))
 done
 
-$pgsql_prefix/bin/createdb -h localhost -p $port db 2>&1 | $pgsql_log
-$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | $pgsql_log
+$pgsql_prefix/bin/createdb -h localhost -p $port db 2>&1 | sh $root/sqldb/logger
+$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
 
 # Generate database backup script
 mkdir -p $root/sqldb/scripts
diff --git a/components/sqldb/pgsql-standby-conf b/components/sqldb/pgsql-standby-conf
index 291d950..59979f3 100755
--- a/components/sqldb/pgsql-standby-conf
+++ b/components/sqldb/pgsql-standby-conf
@@ -54,6 +54,8 @@
     mkdir -p $root/logs
     pgsql_log="cat >>$root/logs/postgresql"
 fi
+mkdir -p $root/sqldb
+echo $pgsql_log >$root/sqldb/logger
 
 mkdir -p $root/sqldb/data
 chmod 700 $root/sqldb/data
@@ -61,7 +63,7 @@
 
 # Initialize from a backup of the master
 if [ ! -f $root/sqldb/data/postgresql.conf ]; then
-    (wget http://$mhost:$mhttpport/pgsql-backup -O - | tar -C $root/sqldb -xz) 2>&1 | $pgsql_log
+    (wget http://$mhost:$mhttpport/pgsql-backup -O - | tar -C $root/sqldb -xz) 2>&1 | sh $root/sqldb/logger
     rm -rf $root/sqldb/data/postmaster.pid $root/sqldb/data/pg_xlog
     mkdir -p $root/sqldb/data/pg_xlog/archive_status
     chmod 700 $root/sqldb/data/pg_xlog/archive_status
diff --git a/components/sqldb/pgsql-start b/components/sqldb/pgsql-start
index 9960c5d..4a7e1eb 100755
--- a/components/sqldb/pgsql-start
+++ b/components/sqldb/pgsql-start
@@ -29,8 +29,10 @@
     mkdir -p $root/logs
     pgsql_log="cat >>$root/logs/postgresql"
 fi
+mkdir -p $root/sqldb
+echo $pgsql_log >$root/sqldb/logger
 
-($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | $pgsql_log)&
+($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger)&
 sti=0
 while [ $sti -ne 30 ]; do
     st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`
diff --git a/components/sqldb/pgsql-stop b/components/sqldb/pgsql-stop
index 9c5c9aa..fbb9997 100755
--- a/components/sqldb/pgsql-stop
+++ b/components/sqldb/pgsql-stop
@@ -29,6 +29,8 @@
     mkdir -p $root/logs
     pgsql_log="cat >>$root/logs/postgresql"
 fi
+mkdir -p $root/sqldb
+echo $pgsql_log >$root/sqldb/logger
 
-$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | $pgsql_log
+$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
 
diff --git a/modules/edit/ssl-start b/modules/edit/ssl-start
index 4a7e779..fdc5a8b 100755
--- a/modules/edit/ssl-start
+++ b/modules/edit/ssl-start
@@ -36,8 +36,8 @@
 fi
 
 # Start memcached
-../../components/cache/memcached-start 11211
-../../components/cache/memcached-start 11212
+../../components/cache/memcached-start tmp 11211
+../../components/cache/memcached-start tmp 11212
 
 # Configure server
 ../../modules/http/httpd-conf tmp sca-store.com 8090 htdocs
diff --git a/modules/edit/start b/modules/edit/start
index 9a56cf7..a6c417b 100755
--- a/modules/edit/start
+++ b/modules/edit/start
@@ -32,8 +32,8 @@
 fi
 
 # Start memcached
-../../components/cache/memcached-start 11211
-../../components/cache/memcached-start 11212
+../../components/cache/memcached-start tmp 11211
+../../components/cache/memcached-start tmp 11212
 
 # Configure server
 ../../modules/http/httpd-conf tmp sca-store.com 8090 htdocs
diff --git a/modules/edit/stop b/modules/edit/stop
index 8e250de..e1fd927 100755
--- a/modules/edit/stop
+++ b/modules/edit/stop
@@ -19,8 +19,8 @@
 
 ../../modules/http/httpd-stop tmp
 
-../../components/cache/memcached-stop 11211
-../../components/cache/memcached-stop 11212
+../../components/cache/memcached-stop tmp 11211
+../../components/cache/memcached-stop tmp 11212
 
 if [ -x ../../components/log/scribe-cat ]; then
     ../../components/log/scribed-client-stop tmp
diff --git a/modules/oauth/start-mixed-test b/modules/oauth/start-mixed-test
index 29ddb6d..d0c1841 100755
--- a/modules/oauth/start-mixed-test
+++ b/modules/oauth/start-mixed-test
@@ -21,8 +21,8 @@
 here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
 
 # Setup
-../../components/cache/memcached-start 11212
-../../components/cache/memcached-start 11213
+../../components/cache/memcached-start tmp 11212
+../../components/cache/memcached-start tmp 11213
 
 ../../modules/http/ssl-ca-conf tmp localhost
 ../../modules/http/ssl-cert-conf tmp localhost
diff --git a/modules/oauth/start-test b/modules/oauth/start-test
index 0e859ce..d38f8d3 100755
--- a/modules/oauth/start-test
+++ b/modules/oauth/start-test
@@ -21,8 +21,8 @@
 ../../ubuntu/ip-redirect-all 80 8090
 ../../ubuntu/ip-redirect-all 443 8453
 
-../../components/cache/memcached-start 11212
-../../components/cache/memcached-start 11213
+../../components/cache/memcached-start tmp 11212
+../../components/cache/memcached-start tmp 11213
 
 ../../modules/http/ssl-ca-conf tmp localhost
 ../../modules/http/ssl-cert-conf tmp localhost
diff --git a/modules/oauth/stop-test b/modules/oauth/stop-test
index a0587f8..4b8a73e 100755
--- a/modules/oauth/stop-test
+++ b/modules/oauth/stop-test
@@ -20,5 +20,5 @@
 # Cleanup
 ../../modules/http/httpd-stop tmp
 
-../../components/cache/memcached-stop 11212
-../../components/cache/memcached-stop 11213
+../../components/cache/memcached-stop tmp 11212
+../../components/cache/memcached-stop tmp 11213
diff --git a/modules/openid/start-test b/modules/openid/start-test
index 7ae27c5..195e1c3 100755
--- a/modules/openid/start-test
+++ b/modules/openid/start-test
@@ -18,8 +18,8 @@
 #  under the License.
 
 # Setup
-../../components/cache/memcached-start 11212
-../../components/cache/memcached-start 11213
+../../components/cache/memcached-start tmp 11212
+../../components/cache/memcached-start tmp 11213
 
 ../../modules/http/ssl-ca-conf tmp localhost
 ../../modules/http/ssl-cert-conf tmp localhost
diff --git a/modules/openid/stop-test b/modules/openid/stop-test
index a0587f8..4b8a73e 100755
--- a/modules/openid/stop-test
+++ b/modules/openid/stop-test
@@ -20,5 +20,5 @@
 # Cleanup
 ../../modules/http/httpd-stop tmp
 
-../../components/cache/memcached-stop 11212
-../../components/cache/memcached-stop 11213
+../../components/cache/memcached-stop tmp 11212
+../../components/cache/memcached-stop tmp 11213
diff --git a/samples/loan-python/start b/samples/loan-python/start
index 499a48c..d334ebc 100755
--- a/samples/loan-python/start
+++ b/samples/loan-python/start
@@ -28,5 +28,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/loan-python/stop b/samples/loan-python/stop
index a59273b..3b4c74a 100755
--- a/samples/loan-python/stop
+++ b/samples/loan-python/stop
@@ -18,4 +18,4 @@
 #  under the License.
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-cluster/ssl-start b/samples/store-cluster/ssl-start
index f80bb07..621a3e7 100755
--- a/samples/store-cluster/ssl-start
+++ b/samples/store-cluster/ssl-start
@@ -56,11 +56,11 @@
 
 # Start three memcached servers
 ../../modules/http/tunnel-ssl-conf tmp/tunnel 11211 localhost 563 11411
-../../components/cache/memcached-start 127.0.0.1:11411
+../../components/cache/memcached-start tmp 127.0.0.1:11411
 ../../modules/http/tunnel-ssl-conf tmp/tunnel 11212 localhost 563 11412
-../../components/cache/memcached-start 127.0.0.1:11412
+../../components/cache/memcached-start tmp 127.0.0.1:11412
 ../../modules/http/tunnel-ssl-conf tmp/tunnel 11213 localhost 563 11413
-../../components/cache/memcached-start 127.0.0.1:11413
+../../components/cache/memcached-start tmp 127.0.0.1:11413
 ../../modules/http/httpd-restart tmp/tunnel
 sleep 1
 
diff --git a/samples/store-cluster/ssl-stop b/samples/store-cluster/ssl-stop
index ff36721..37addf8 100755
--- a/samples/store-cluster/ssl-stop
+++ b/samples/store-cluster/ssl-stop
@@ -26,9 +26,9 @@
 ../../modules/http/httpd-stop tmp/proxy1
 ../../modules/http/httpd-stop tmp/proxy2
 
-../../components/cache/memcached-stop 127.0.0.1:11411
-../../components/cache/memcached-stop 127.0.0.1:11412
-../../components/cache/memcached-stop 127.0.0.1:11413
+../../components/cache/memcached-stop tmp 127.0.0.1:11411
+../../components/cache/memcached-stop tmp 127.0.0.1:11412
+../../components/cache/memcached-stop tmp 127.0.0.1:11413
 
 ../../components/sqldb/pgsql-stop tmp/sqldb3
 ../../modules/http/httpd-stop tmp/sqldb3
diff --git a/samples/store-cluster/start b/samples/store-cluster/start
index 67434d6..0aa6e42 100755
--- a/samples/store-cluster/start
+++ b/samples/store-cluster/start
@@ -33,9 +33,9 @@
 sleep 1
 
 # Start three memcached servers
-../../components/cache/memcached-start 11211
-../../components/cache/memcached-start 11212
-../../components/cache/memcached-start 11213
+../../components/cache/memcached-start tmp 11211
+../../components/cache/memcached-start tmp 11212
+../../components/cache/memcached-start tmp 11213
 
 # Start a master and two hot standby databases
 ./sqldb-master-conf tmp/sqldb1 5432 8502
diff --git a/samples/store-cluster/stop b/samples/store-cluster/stop
index b2fa11b..fb6c648 100755
--- a/samples/store-cluster/stop
+++ b/samples/store-cluster/stop
@@ -26,9 +26,9 @@
 ../../modules/http/httpd-stop tmp/proxy1
 ../../modules/http/httpd-stop tmp/proxy2
 
-../../components/cache/memcached-stop 11211
-../../components/cache/memcached-stop 11212
-../../components/cache/memcached-stop 11213
+../../components/cache/memcached-stop tmp 11211
+../../components/cache/memcached-stop tmp 11212
+../../components/cache/memcached-stop tmp 11213
 
 ../../components/sqldb/pgsql-stop tmp/sqldb3
 ../../modules/http/httpd-stop tmp/sqldb3
diff --git a/samples/store-cpp/ssl-start b/samples/store-cpp/ssl-start
index 01ee0eb..3a96fe9 100755
--- a/samples/store-cpp/ssl-start
+++ b/samples/store-cpp/ssl-start
@@ -32,5 +32,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-cpp/start b/samples/store-cpp/start
index c0f2813..444a87c 100755
--- a/samples/store-cpp/start
+++ b/samples/store-cpp/start
@@ -28,5 +28,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-cpp/stop b/samples/store-cpp/stop
index a59273b..3b4c74a 100755
--- a/samples/store-cpp/stop
+++ b/samples/store-cpp/stop
@@ -18,4 +18,4 @@
 #  under the License.
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-java/ssl-start b/samples/store-java/ssl-start
index 3d4642d..a585f71 100755
--- a/samples/store-java/ssl-start
+++ b/samples/store-java/ssl-start
@@ -34,5 +34,5 @@
 
 export CLASSPATH=`pwd`/../../modules/java/libmod-tuscany-java-1.0.jar:`pwd`
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-java/start b/samples/store-java/start
index c8146e9..6952771 100755
--- a/samples/store-java/start
+++ b/samples/store-java/start
@@ -29,5 +29,5 @@
 
 export CLASSPATH=`pwd`/../../modules/java/libmod-tuscany-java-1.0.jar:`pwd`
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-java/stop b/samples/store-java/stop
index 79d914e..c7a0bff 100755
--- a/samples/store-java/stop
+++ b/samples/store-java/stop
@@ -20,4 +20,4 @@
 export CLASSPATH=`pwd`/../../modules/java/libmod-tuscany-java-1.0.jar:`pwd`
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-python/ssl-start b/samples/store-python/ssl-start
index e639b53..2a9df09 100755
--- a/samples/store-python/ssl-start
+++ b/samples/store-python/ssl-start
@@ -33,5 +33,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-python/start b/samples/store-python/start
index b4ca146..2e509a1 100755
--- a/samples/store-python/start
+++ b/samples/store-python/start
@@ -28,5 +28,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-python/stop b/samples/store-python/stop
index a59273b..3b4c74a 100755
--- a/samples/store-python/stop
+++ b/samples/store-python/stop
@@ -18,4 +18,4 @@
 #  under the License.
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-python/uec2-start b/samples/store-python/uec2-start
index 53428be..feb4ae3 100755
--- a/samples/store-python/uec2-start
+++ b/samples/store-python/uec2-start
@@ -42,6 +42,6 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
 
diff --git a/samples/store-scheme/ssl-start b/samples/store-scheme/ssl-start
index 70e62f1..cc0272c 100755
--- a/samples/store-scheme/ssl-start
+++ b/samples/store-scheme/ssl-start
@@ -32,5 +32,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-scheme/start b/samples/store-scheme/start
index 335e5bb..f3575db 100755
--- a/samples/store-scheme/start
+++ b/samples/store-scheme/start
@@ -28,5 +28,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-scheme/stop b/samples/store-scheme/stop
index a59273b..3b4c74a 100755
--- a/samples/store-scheme/stop
+++ b/samples/store-scheme/stop
@@ -18,4 +18,4 @@
 #  under the License.
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-sql/ssl-start b/samples/store-sql/ssl-start
index 58ce207..adfba0d 100755
--- a/samples/store-sql/ssl-start
+++ b/samples/store-sql/ssl-start
@@ -32,7 +32,7 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../components/sqldb/pgsql-conf tmp
 ../../components/sqldb/pgsql-start tmp
 ../../components/sqldb/pgsql "create table store(key text, value text);" 1>/dev/null 2>&1
diff --git a/samples/store-sql/start b/samples/store-sql/start
index 2628f99..d4cf3c2 100755
--- a/samples/store-sql/start
+++ b/samples/store-sql/start
@@ -28,7 +28,7 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../components/sqldb/pgsql-conf tmp
 ../../components/sqldb/pgsql-start tmp
 ../../components/sqldb/pgsql "create table store(key text, value text);" 1>/dev/null 2>&1
diff --git a/samples/store-sql/stop b/samples/store-sql/stop
index 2226018..daf271c 100755
--- a/samples/store-sql/stop
+++ b/samples/store-sql/stop
@@ -19,4 +19,4 @@
 
 ../../modules/http/httpd-stop tmp
 ../../components/sqldb/pgsql-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-vhost/ssl-start b/samples/store-vhost/ssl-start
index a556d48..17f4e7f 100755
--- a/samples/store-vhost/ssl-start
+++ b/samples/store-vhost/ssl-start
@@ -44,5 +44,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-vhost/start b/samples/store-vhost/start
index ee6f613..0b5740a 100755
--- a/samples/store-vhost/start
+++ b/samples/store-vhost/start
@@ -34,5 +34,5 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp
diff --git a/samples/store-vhost/stop b/samples/store-vhost/stop
index a59273b..3b4c74a 100755
--- a/samples/store-vhost/stop
+++ b/samples/store-vhost/stop
@@ -18,4 +18,4 @@
 #  under the License.
 
 ../../modules/http/httpd-stop tmp
-../../components/cache/memcached-stop
+../../components/cache/memcached-stop tmp
diff --git a/samples/store-vhost/uec2-start b/samples/store-vhost/uec2-start
index 70de35e..385021a 100755
--- a/samples/store-vhost/uec2-start
+++ b/samples/store-vhost/uec2-start
@@ -47,6 +47,6 @@
 
 EOF
 
-../../components/cache/memcached-start
+../../components/cache/memcached-start tmp
 ../../modules/http/httpd-start tmp