diff options
author | startxfr <clarue@startx.fr> | 2014-12-08 02:35:03 +0100 |
---|---|---|
committer | startxfr <clarue@startx.fr> | 2014-12-08 02:35:03 +0100 |
commit | ef2c1df934ee7720fd1ccacae042f3deb3b7628d (patch) | |
tree | 005eb1b5402f274f8643fa2d85ffa81da917a225 /Services/memcache/sx/memcache.sh | |
parent | a7f649b8f1f56a999073550d1b91b5d8d1cd7d81 (diff) | |
download | phpmyadmin-ef2c1df934ee7720fd1ccacae042f3deb3b7628d.tar.gz phpmyadmin-ef2c1df934ee7720fd1ccacae042f3deb3b7628d.tar.bz2 phpmyadmin-ef2c1df934ee7720fd1ccacae042f3deb3b7628d.tar.xz phpmyadmin-ef2c1df934ee7720fd1ccacae042f3deb3b7628d.zip |
adding function and startup script for last services images : memcache, nodejs, ooconv and postresql
Diffstat (limited to 'Services/memcache/sx/memcache.sh')
-rw-r--r-- | Services/memcache/sx/memcache.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Services/memcache/sx/memcache.sh b/Services/memcache/sx/memcache.sh new file mode 100644 index 0000000..d963a29 --- /dev/null +++ b/Services/memcache/sx/memcache.sh @@ -0,0 +1,41 @@ +#!/bin/bash +export TERM=dumb + +# Begin configuration before starting daemonized process +# and start generating host keys +function begin_config { + echo "=> Begin memcached configuration for host $HOSTNAME" +} + +# End configuration process just before starting daemon +function end_config { + stop_server + echo "=> End memcached configuration ..." +} + +# Start the memcached server in background. Used to perform config +# against the database structure such as user creation +function start_server { + echo "===> Starting memcached server ..." + memcached -u daemon -d & + sleep 8 +} + +# Stop the memcached server running in background. +function stop_server { + echo "===> Stopping memcached server ..." + killall memcached + sleep 8 +} + +# Start the memcached server as a deamon and execute it inside +# the running shell +function start_daemon { + echo "=> Starting memcached daemon ..." + exec memcached -u daemon +} + + +if [[ "$0" == *"memcached.sh" && ! $1 = "" ]];then + eval "$@"; +fi
\ No newline at end of file |