2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-05-25 23:17:01 +02:00

Use flock for the upgrade process

This commit is contained in:
Philipp Holzer 2023-05-04 14:50:22 +02:00
parent 460e273adc
commit 003826bcd3
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
7 changed files with 686 additions and 616 deletions

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"

View file

@ -69,6 +69,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
} > /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 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"
if [ -f /var/www/html/VERSION ]; then
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"
fi
fi
) 9> /var/www/html/nextcloud-init-sync.lock
fi
exec "$@"