Nicolas Massé 3 months ago
parent
commit
7bd03f4a1d
  1. 6
      bootc/scenario1/root/etc/containers/systemd/nextcloud-app.container
  2. 4
      bootc/scenario1/root/etc/greenboot/check/required.d/30_nextcloud_check.sh
  3. 4
      bootc/scenario1/root/etc/systemd/system/nextcloud.target
  4. 2
      bootc/scenario4/root/etc/greenboot/check/required.d/30_odoo_check.sh

6
bootc/scenario1/root/etc/containers/systemd/nextcloud-fpm.container → bootc/scenario1/root/etc/containers/systemd/nextcloud-app.container

@ -26,7 +26,7 @@ EnvironmentFile=/etc/containers/systemd/configs/nextcloud-app.env
EnvironmentFile=/etc/containers/systemd/configs/nextcloud-config.env EnvironmentFile=/etc/containers/systemd/configs/nextcloud-config.env
# Volume mounts # Volume mounts
Volume=/var/lib/nextcloud:/var/www/html:z Volume=/var/lib/nextcloud/data:/var/www/html:z
Volume=/var/lib/nextcloud/config/www.conf:/usr/local/etc/php-fpm.d/www.conf:Z Volume=/var/lib/nextcloud/config/www.conf:/usr/local/etc/php-fpm.d/www.conf:Z
Volume=/var/lib/nextcloud/config/redis-session.ini:/usr/local/etc/php/conf.d/redis-session.ini:Z Volume=/var/lib/nextcloud/config/redis-session.ini:/usr/local/etc/php/conf.d/redis-session.ini:Z
@ -45,8 +45,8 @@ TimeoutStopSec=30
# Skaffold filesystem + fix permissions # Skaffold filesystem + fix permissions
ExecStartPre=/bin/bash -Eeuo pipefail -c 'install -m 0700 -o 82 -g 82 -d /var/lib/nextcloud/data /var/lib/nextcloud/config ; \ ExecStartPre=/bin/bash -Eeuo pipefail -c 'install -m 0700 -o 82 -g 82 -d /var/lib/nextcloud/data /var/lib/nextcloud/config ; \
install -m 0700 -o 82 -g 82 -d /etc/containers/systemd/configs/www.conf /var/lib/nextcloud/config/www.conf ; \ install -m 0700 -o 82 -g 82 /etc/containers/systemd/configs/www.conf /var/lib/nextcloud/config/www.conf ; \
install -m 0700 -o 82 -g 82 -d /etc/containers/systemd/configs/redis-session.ini /var/lib/nextcloud/config/redis-session.ini' install -m 0700 -o 82 -g 82 /etc/containers/systemd/configs/redis-session.ini /var/lib/nextcloud/config/redis-session.ini'
# Wait for PostgreSQL to be ready # Wait for PostgreSQL to be ready
ExecStartPre=/bin/sh -c 'exec 2>/dev/null; for try in $(seq 0 12); do if ! /bin/true 5<> /dev/tcp/127.0.0.1/5432; then echo "Waiting for PostgreSQL to be available..."; sleep 5; else exit 0; fi; done; exit 1' ExecStartPre=/bin/sh -c 'exec 2>/dev/null; for try in $(seq 0 12); do if ! /bin/true 5<> /dev/tcp/127.0.0.1/5432; then echo "Waiting for PostgreSQL to be available..."; sleep 5; else exit 0; fi; done; exit 1'

4
bootc/scenario1/root/etc/greenboot/check/required.d/30_nextcloud_check.sh

@ -4,11 +4,11 @@ set -Eeuo pipefail
declare -a container_state=() declare -a container_state=()
MAX_ATTEMPTS=60 MAX_ATTEMPTS=60
for attempt in (( i=1; i<=MAX_ATTEMPTS; i++ )); do for (( attempt=1; attempt<=MAX_ATTEMPTS; attempt++ )); do
echo "Checking Nextcloud deployment ($attempt/$MAX_ATTEMPTS)..." echo "Checking Nextcloud deployment ($attempt/$MAX_ATTEMPTS)..."
state=1 state=1
for container in nextcloud-db nextcloud-redis nextcloud-fpm nextcloud-nginx; do for container in nextcloud-db nextcloud-redis nextcloud-app nextcloud-nginx; do
container_state=( $( ( podman inspect "$container" || true ) | jq -r '.[0].State.Status // "unknown", .[0].State.Health.Status // "unknown"') ) container_state=( $( ( podman inspect "$container" || true ) | jq -r '.[0].State.Status // "unknown", .[0].State.Health.Status // "unknown"') )
echo "Container $container has state ${container_state[0]} and its health is ${container_state[1]}!" echo "Container $container has state ${container_state[0]} and its health is ${container_state[1]}!"
if [[ "${container_state[0]}-${container_state[1]}" != "running-healthy" ]]; then if [[ "${container_state[0]}-${container_state[1]}" != "running-healthy" ]]; then

4
bootc/scenario1/root/etc/systemd/system/nextcloud.target

@ -1,8 +1,8 @@
[Unit] [Unit]
Description=Nextcloud Service Target Description=Nextcloud Service Target
Documentation=man:systemd.target(5) Documentation=man:systemd.target(5)
Wants=nextcloud-db.service nextcloud-redis.service nextcloud-fpm.service nextcloud-nginx.service Wants=nextcloud-db.service nextcloud-redis.service nextcloud-app.service nextcloud-nginx.service
After=nextcloud-db.service nextcloud-redis.service nextcloud-fpm.service nextcloud-nginx.service After=nextcloud-db.service nextcloud-redis.service nextcloud-app.service nextcloud-nginx.service
# Allow isolation - can stop/start this target independently # Allow isolation - can stop/start this target independently
AllowIsolate=yes AllowIsolate=yes

2
bootc/scenario4/root/etc/greenboot/check/required.d/30_odoo_check.sh

@ -4,7 +4,7 @@ set -Eeuo pipefail
declare -a container_state=() declare -a container_state=()
MAX_ATTEMPTS=60 MAX_ATTEMPTS=60
for attempt in (( i=1; i<=MAX_ATTEMPTS; i++ )); do for (( attempt=1; attempt<=MAX_ATTEMPTS; attempt++ )); do
echo "Checking Odoo deployment ($attempt/$MAX_ATTEMPTS)..." echo "Checking Odoo deployment ($attempt/$MAX_ATTEMPTS)..."
state=1 state=1

Loading…
Cancel
Save