From b89bcf6d9c18aa5aa9764034fad9ce6de303cc3e Mon Sep 17 00:00:00 2001 From: Kevin Jilissen Date: Tue, 22 Oct 2024 13:51:49 +0200 Subject: [PATCH] Allow deletion of default config to fail If the container is restarted, the configuration file does not exist. Do not fail the `rm` command if the file could not be removed to ensure idempotency of the Apache2 configuration part. Fixes an issue introduced in 628381697202122168e7e227e36a7562a492471f. --- docker-contributor/scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-contributor/scripts/start.sh b/docker-contributor/scripts/start.sh index e1866cf..1b08574 100644 --- a/docker-contributor/scripts/start.sh +++ b/docker-contributor/scripts/start.sh @@ -157,7 +157,7 @@ sudo a2enmod proxy_fcgi setenvif rewrite sudo cp "/etc/apache2/conf-available/php$DEFAULTPHPVERSION-fpm.conf" /etc/apache2/conf-available/php-domjudge-fpm.conf sudo sed -i 's/proxy:unix:.*|/proxy:unix:\/var\/run\/php-fpm-domjudge.sock|/' /etc/apache2/conf-available/php-domjudge-fpm.conf sudo a2enconf php-domjudge-fpm domjudge -sudo rm /etc/apache2/sites-enabled/000-default.conf +sudo rm -f /etc/apache2/sites-enabled/000-default.conf # Run DOMjudge in root sudo sed -i '/^#/,/^#<\/VirtualHost>/ s/#//' $APACHE2_CONFIG_FILE sudo sed -i 's/^Alias \/domjudge/#Alias \/domjudge/' $APACHE2_CONFIG_FILE