Merge "Stop supervisor service when stopping container"

This commit is contained in:
Jenkins 2015-08-19 13:10:37 +00:00 committed by Gerrit Code Review
commit ed5e1b1a63

View File

@ -235,6 +235,10 @@ function start_container {
${DOCKER} start $container_name ${DOCKER} start $container_name
fi fi
post_start_hooks $1 post_start_hooks $1
if [ -z "$SUPERVISOR_PROCESS_NAME" ]; then
#Refresh supervisor for container in case it was disabled
supervisorctl start docker-$container > /dev/null
fi
if [ "$2" = "--attach" ]; then if [ "$2" = "--attach" ]; then
attach_container $container_name attach_container $container_name
fi fi
@ -317,14 +321,21 @@ function lxc_shell_container {
} }
function stop_container { function stop_container {
if [[ "$1" == 'all' ]]; then if [ "$1" = "all" ]; then
${DOCKER} stop ${CONTAINER_NAMES[@]} for container in ${CONTAINER_NAMES[@]}; do
else stop_container $container
for container in $@; do
echo "Stopping $container..."
${DOCKER} stop ${CONTAINER_NAMES[$container]}
done done
return
fi fi
for container in $@; do
echo "Stopping $container..."
#Stop supervisor process if manually shut down by user
if [ -z "$SUPERVISOR_PROCESS_NAME" ]; then
supervisorctl stop "docker-${container}" > /dev/null
fi
${DOCKER} stop ${CONTAINER_NAMES[$container]}
done
} }
function destroy_container { function destroy_container {