mirror of
https://github.com/nextcloud/docker.git
synced 2024-12-26 11:06:14 +01:00
Use flock to lock the whole upgrade process
Signed-off-by: Remi Rampin <remi@rampin.org>
This commit is contained in:
parent
df9653a00c
commit
4667cbe149
1 changed files with 15 additions and 1 deletions
|
@ -220,7 +220,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||
fi
|
||||
|
||||
# If another process is syncing the html folder, wait for
|
||||
# it to be done, then escape initalization.
|
||||
# You need to define the NEXTCLOUD_INIT_LOCK environment variable
|
||||
if [ -n "${NEXTCLOUD_INIT_LOCK+x}" ]; then
|
||||
(
|
||||
if ! flock -n 9; then
|
||||
# If we couldn't get it immediately, show a message, then wait for real
|
||||
echo "Another process is initializing Nextcloud. Waiting..."
|
||||
flock 9
|
||||
fi
|
||||
do_install_or_upgrade
|
||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||
else
|
||||
do_install_or_upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
|
Loading…
Reference in a new issue