From a490cfe364a242b1e9993225758ea6e61369e363 Mon Sep 17 00:00:00 2001 From: startxfr Date: Sat, 28 Nov 2015 23:32:45 +0100 Subject: reshapping of memcache container --- Services/memcache/run.sh | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Services/memcache/run.sh (limited to 'Services/memcache/run.sh') diff --git a/Services/memcache/run.sh b/Services/memcache/run.sh new file mode 100644 index 0000000..bc4279e --- /dev/null +++ b/Services/memcache/run.sh @@ -0,0 +1,62 @@ +#!/bin/bash +source /bin/sx-lib.sh + + +function display_container_memcache_header { + echo "+=====================================================" + echo "| Container : $HOSTNAME" + echo "| OS : $( BEGIN MEMCACHE CONFIGURATION" + if [[ ! -d $LOG_PATH ]]; then + echo "log directory $LOG_PATH not found" + mkdir -p $LOG_PATH; + echo "log directory $LOG_PATH CREATED" + else + echo "log directory $LOG_PATH EXIST" + fi + chmod 0774 $LOG_PATH; +} + +# End configuration process just before starting daemon +function end_config { + echo "=> END MEMCACHE CONFIGURATION" +} + +# Start the memcache server as a deamon and execute it inside +# the running shell +function start_daemon { + echo "=> Starting memcache daemon ..." + display_container_started + exec memcached -u daemon -v +} + + +if [[ "$0" == *"run.sh" && ! $1 = "" ]];then + eval "$@"; +fi + +check_environment | tee -a $STARTUPLOG +display_container_memcache_header | tee -a $STARTUPLOG +begin_config | tee -a $STARTUPLOG +end_config | tee -a $STARTUPLOG +start_daemon | tee -a $STARTUPLOG -- cgit v1.2.3