summaryrefslogtreecommitdiffstats
path: root/Services/memcache/run.sh
diff options
context:
space:
mode:
authorstartxfr <clarue@startx.fr>2016-02-06 05:05:57 +0100
committerstartxfr <clarue@startx.fr>2016-02-06 05:05:57 +0100
commit5cff390c081bdfb756a8977ad0bd56d778202d6b (patch)
treece018b9be9ad054e4f7aa6891d7b4668c1ad74af /Services/memcache/run.sh
parent0f3bcf30ae748a75c22a03d4655dba4d8dc71185 (diff)
downloadphpmyadmin-5cff390c081bdfb756a8977ad0bd56d778202d6b.tar.gz
phpmyadmin-5cff390c081bdfb756a8977ad0bd56d778202d6b.tar.bz2
phpmyadmin-5cff390c081bdfb756a8977ad0bd56d778202d6b.tar.xz
phpmyadmin-5cff390c081bdfb756a8977ad0bd56d778202d6b.zip
reorg avec gestion des sig
Diffstat (limited to 'Services/memcache/run.sh')
-rw-r--r--Services/memcache/run.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/Services/memcache/run.sh b/Services/memcache/run.sh
index 77ef648..3c5a8cd 100644
--- a/Services/memcache/run.sh
+++ b/Services/memcache/run.sh
@@ -42,21 +42,27 @@ function end_config {
echo "=> END MEMCACHE CONFIGURATION"
}
+function stop_memcache_handler {
+ killall memcached
+ echo "+=====================================================" | tee -a $STARTUPLOG
+ echo "| Container $HOSTNAME is now STOPPED" | tee -a $STARTUPLOG
+ echo "+=====================================================" | tee -a $STARTUPLOG
+ exit 143; # 128 + 15 -- SIGTERM
+}
+
+
# Start the memcache server as a deamon and execute it inside
# the running shell
-function start_daemon {
- echo "=> Starting memcache daemon ..." | tee -a $STARTUPLOG
- display_container_started | tee -a $STARTUPLOG
+function start_service_memcache {
+ trap 'kill ${!}; stop_memcache_handler' SIGHUP SIGINT SIGQUIT SIGTERM SIGKILL SIGSTOP SIGCONT
+ echo "+=====================================================" | tee -a $STARTUPLOG
+ echo "| Container $HOSTNAME is now RUNNING" | tee -a $STARTUPLOG
+ echo "+=====================================================" | tee -a $STARTUPLOG
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
+start_service_memcache