mariadb: Move to Quadlet

This commit is contained in:
Alex Palaistras 2023-08-12 11:49:30 +01:00
parent 6ead546a9d
commit ee4375869d
4 changed files with 22 additions and 26 deletions

View File

@ -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.: 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. The systemd journal should provide evidence of execution and reference to any issues that may have occured.

View File

@ -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

View File

@ -6,7 +6,5 @@ storage:
local: service/mariadb/ local: service/mariadb/
- path: /etc/systemd/system - path: /etc/systemd/system
local: service/mariadb/systemd/ local: service/mariadb/systemd/
systemd: - path: /etc/containers/systemd
units: local: service/mariadb/quadlet/
- name: mariadb.service
enabled: true

View File

@ -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