Merge "Stop supervisor service when stopping container"
This commit is contained in:
commit
ed5e1b1a63
@ -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
|
||||||
|
done
|
||||||
|
return
|
||||||
|
fi
|
||||||
for container in $@; do
|
for container in $@; do
|
||||||
echo "Stopping $container..."
|
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]}
|
${DOCKER} stop ${CONTAINER_NAMES[$container]}
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroy_container {
|
function destroy_container {
|
||||||
|
Loading…
Reference in New Issue
Block a user