diff --git a/service/mariadb/README.md b/service/mariadb/README.md index 3ed1fcd..0c55353 100644 --- a/service/mariadb/README.md +++ b/service/mariadb/README.md @@ -55,7 +55,7 @@ service-specific `example/example.env.template` file (if any exists). Running th simple a matter as running the aforementioned service, e.g.: ``` -sudo systemctl start mariadb-migrate@example +sudo systemctl start mariadb-migrate@example ``` The systemd journal should provide evidence of execution and reference to any issues that may have occured. diff --git a/service/mariadb/quadlet/mariadb.container b/service/mariadb/quadlet/mariadb.container new file mode 100644 index 0000000..e5e7e82 --- /dev/null +++ b/service/mariadb/quadlet/mariadb.container @@ -0,0 +1,19 @@ +[Unit] +Description=MariaDB SQL Database +Wants=container-build@%N.service container-volume@%N.service +After=container-build@%N.service container-volume@%N.service + +[Container] +ContainerName=%N +EnvironmentFile=%E/coreos-home-server/%N/%N.env +HealthCmd=mariadb-admin -uroot -p$MYSQL_ROOT_PASSWORD ping +Image=localhost/%N:latest +Network=internal +Notify=true +Volume=%N:/var/lib/mysql:z + +[Service] +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/service/mariadb/spec.bu b/service/mariadb/spec.bu index ab33818..6a713db 100644 --- a/service/mariadb/spec.bu +++ b/service/mariadb/spec.bu @@ -6,7 +6,5 @@ storage: local: service/mariadb/ - path: /etc/systemd/system local: service/mariadb/systemd/ -systemd: - units: - - name: mariadb.service - enabled: true + - path: /etc/containers/systemd + local: service/mariadb/quadlet/ diff --git a/service/mariadb/systemd/mariadb.service b/service/mariadb/systemd/mariadb.service deleted file mode 100644 index c231eb3..0000000 --- a/service/mariadb/systemd/mariadb.service +++ /dev/null @@ -1,21 +0,0 @@ -[Unit] -Description=MariaDB SQL Database -Wants=container-build@%N.service container-volume@%N.service -After=container-build@%N.service container-volume@%N.service - -[Service] -Type=notify -NotifyAccess=all -SyslogIdentifier=%N -Restart=on-failure -Environment=PODMAN_SYSTEMD_UNIT=%n -ExecStart=/bin/podman run --replace --name %N --net internal \ - --env-file %E/coreos-home-server/%N/%N.env \ - --volume %N:/var/lib/mysql:z \ - --health-cmd 'mariadb-admin -uroot -p$MYSQL_ROOT_PASSWORD ping' \ - localhost/%N:latest -ExecStop=/bin/podman stop --ignore --time 10 %N -ExecStopPost=/bin/podman rm --ignore --force %N - -[Install] -WantedBy=multi-user.target