mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-05-13 18:33:34 +00:00
With su-exec, make sure the SIGTERM upon docker stop could be received by the running program thus causing a clean stop/exit. Signed-off-by: Qi Zheng <qi.zheng@intel.com>
14 lines
229 B
Bash
14 lines
229 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# first arg is `-f` or `--some-option`
|
|
if [ "${1#-}" != "$1" ]; then
|
|
set -- memcached "$@"
|
|
fi
|
|
|
|
if [ "$1" = 'memcached' -a "$(id -u)" = '0' ]; then
|
|
exec su-exec memcached "$BASH_SOURCE" "$@"
|
|
fi
|
|
|
|
exec "$@"
|