From b9793a267b3db60e559c5affc7c6a10988324168 Mon Sep 17 00:00:00 2001 From: TheEdgeOfRage Date: Tue, 12 Jul 2022 14:02:31 +0000 Subject: [PATCH] Add exec to run script to run app as PID 1 (#1200) When running the docker container, the sh script will run as PID 1 and intercept any external signals (like docker stop) and won't pass it on to the app. Docker will wait for 10 seconds before proceeding to force kill the app, leading to both an unclean shutdown and an unnecessary wait of 10 seconds. The exec in the script replaces the shell process with the `su` process, which correctly passes on signals to the app process and triggers a regular shutdown when doing a docker stop. Co-authored-by: Pavle Portic Reviewed-on: https://kolaente.dev/vikunja/api/pulls/1200 Reviewed-by: konrad Co-authored-by: TheEdgeOfRage Co-committed-by: TheEdgeOfRage --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index c7258da4e..aa22c9850 100755 --- a/run.sh +++ b/run.sh @@ -4,4 +4,4 @@ usermod --non-unique --uid ${PUID} vikunja groupmod --non-unique --gid ${PGID} vikunja -su vikunja -c '/app/vikunja/vikunja' \ No newline at end of file +exec su vikunja -c '/app/vikunja/vikunja' \ No newline at end of file