mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-09-01 02:35:02 +00:00
Use su-exec to run commands on entryponit
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>
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ RUN source /os-release && \
|
||||
mkdir /install_root \
|
||||
&& swupd os-install -V ${VERSION_ID} \
|
||||
--path /install_root --statedir /swupd-state \
|
||||
--bundles=postgresql --no-boot-update
|
||||
--bundles=postgresql,su-exec --no-boot-update
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
|
||||
@@ -51,7 +51,7 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
fi
|
||||
sed -i "s|#listen_addresses.*|listen_addresses = '*'|" /usr/share/postgresql/postgresql.conf.sample
|
||||
|
||||
exec su postgres -s /bin/bash -c "$BASH_SOURCE $@"
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
|
||||
Reference in New Issue
Block a user