mirror of
https://github.com/nextcloud/docker.git
synced 2024-11-18 02:56:42 +01:00
Remove NEXTCLOUD_INIT_LOCK
Signed-off-by: Remi Rampin <remi@rampin.org>
This commit is contained in:
parent
295cdf7fb7
commit
8aabc4b3ea
2 changed files with 8 additions and 17 deletions
|
@ -137,11 +137,7 @@ The install and update script is only triggered when a default command is used (
|
||||||
|
|
||||||
- `NEXTCLOUD_UPDATE` (default: `0`)
|
- `NEXTCLOUD_UPDATE` (default: `0`)
|
||||||
|
|
||||||
If you share your html folder with multiple docker containers, you might want to avoid multiple processes updating the same shared volume
|
You might want to make sure the htaccess is up to date after each container update. Especially on multiple swarm nodes as any discrepancy will make your server unusable.
|
||||||
|
|
||||||
- `NEXTCLOUD_INIT_LOCK` (not set by default) Set it to true to enable initialization locking. Other containers will wait for the current process to finish updating the html volume to continue.
|
|
||||||
|
|
||||||
You might also want to make sure the htaccess is up to date after each container update. Especially on multiple swarm nodes as any discrepancy will make your server unusable.
|
|
||||||
|
|
||||||
- `NEXTCLOUD_INIT_HTACCESS` (not set by default) Set it to true to enable run `occ maintenance:update:htaccess` after container initialization.
|
- `NEXTCLOUD_INIT_HTACCESS` (not set by default) Set it to true to enable run `occ maintenance:update:htaccess` after container initialization.
|
||||||
|
|
||||||
|
|
|
@ -222,19 +222,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
|
|
||||||
# If another process is syncing the html folder, wait for
|
# If another process is syncing the html folder, wait for
|
||||||
# it to be done, then escape initalization.
|
# 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
|
||||||
if ! flock -n 9; then
|
echo "Another process is initializing Nextcloud. Waiting..."
|
||||||
# If we couldn't get it immediately, show a message, then wait for real
|
flock 9
|
||||||
echo "Another process is initializing Nextcloud. Waiting..."
|
fi
|
||||||
flock 9
|
|
||||||
fi
|
|
||||||
do_install_or_upgrade
|
|
||||||
) 9> /var/www/html/nextcloud-init-sync.lock
|
|
||||||
else
|
|
||||||
do_install_or_upgrade
|
do_install_or_upgrade
|
||||||
fi
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
Loading…
Reference in a new issue