mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #352 from Strubbl/fix-unwanted-exit-in-docker-entrypoint.sh
fix bug where docker-entrypoint.sh exits w/o notice
This commit is contained in:
commit
24bdc07e14
@ -46,11 +46,10 @@ migrations() {
|
|||||||
# A simple lock file in case other containers use this startup
|
# A simple lock file in case other containers use this startup
|
||||||
LOCKFILE="/usr/src/paperless/data/db.sqlite3.migration"
|
LOCKFILE="/usr/src/paperless/data/db.sqlite3.migration"
|
||||||
|
|
||||||
set -o noclobber
|
|
||||||
# check for and create lock file in one command
|
# check for and create lock file in one command
|
||||||
(> ${LOCKFILE}) &> /dev/null
|
if (set -o noclobber; echo "$$" > "${LOCKFILE}") 2> /dev/null
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
|
trap 'rm -f "${LOCKFILE}"; exit $?' INT TERM EXIT
|
||||||
sudo -HEu paperless "/usr/src/paperless/src/manage.py" "migrate"
|
sudo -HEu paperless "/usr/src/paperless/src/manage.py" "migrate"
|
||||||
rm ${LOCKFILE}
|
rm ${LOCKFILE}
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user