mirror of
https://github.com/friendica/docker
synced 2025-04-01 08:37:23 +02:00
Use flock for the upgrade process
This commit is contained in:
parent
460e273adc
commit
003826bcd3
7 changed files with 686 additions and 616 deletions
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
} > /usr/local/etc/php/conf.d/redis-session.ini
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If another process is syncing the html folder, wait for
|
||||||
|
# it to be done, then escape initialization.
|
||||||
|
(
|
||||||
|
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
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
installed_version="0.0.0.0"
|
||||||
if [ -f /var/www/html/VERSION ]; then
|
if [ -f /var/www/html/VERSION ]; then
|
||||||
installed_version="$(cat /var/www/html/VERSION)"
|
installed_version="$(cat /var/www/html/VERSION)"
|
||||||
|
@ -170,6 +179,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
|
||||||
echo "Upgrading finished"
|
echo "Upgrading finished"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
) 9> /var/www/html/nextcloud-init-sync.lock
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue