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:
Qi Zheng
2019-07-19 07:46:46 +00:00
committed by qzheng527
parent a65feb31a6
commit 3259d3bab3
14 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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