coreos-home-server/config/service/mariadb/systemd/mariadb.service
Alex Palaistras bb5482ed6d mariadb: Implement health-checks and ready notify
This integrates systemd ready notifications against native support
available in MariaDB, and integrates health-checks for good measure.
2021-09-25 16:53:33 +01:00

22 lines
739 B
Desktop File

[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