Apparently terminating the ssh connection that runs 'docker exec' may result in a process leak as the signal isn't propagated properly (moby/moby#9098). Since we cannot fix this, we should document it so that users do not stumble upon the issue unawares. Closes dokku/dokku-postgres#212
27 lines
1.1 KiB
Bash
Executable File
27 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_BASE_PATH/common/functions"
|
|
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
|
|
|
service-enter-cmd() {
|
|
#E a bash prompt can be opened against a running service.
|
|
#E filesystem changes will not be saved to disk.
|
|
#E > NOTE: disconnecting from ssh while running this command may leave zombie processes due to moby/moby#9098
|
|
#E dokku $PLUGIN_COMMAND_PREFIX:enter lollipop
|
|
#E you may also run a command directly against the service.
|
|
#E filesystem changes will not be saved to disk.
|
|
#E dokku $PLUGIN_COMMAND_PREFIX:enter lollipop touch /tmp/test
|
|
#A service, service to run command against
|
|
declare desc="enter or run a command in a running $PLUGIN_SERVICE service container"
|
|
local cmd="$PLUGIN_COMMAND_PREFIX:enter" argv=("$@")
|
|
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
|
declare SERVICE="$1"
|
|
|
|
dokku_log_info1_quiet "Filesystem changes may not persist after container restarts"
|
|
service_enter "$SERVICE" "${@:2}"
|
|
}
|
|
|
|
service-enter-cmd "$@"
|