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.
This commit is contained in:
Alex Palaistras 2021-09-25 16:53:33 +01:00
parent b3b2840c37
commit bb5482ed6d

View File

@ -9,9 +9,10 @@ NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
ExecStart=/bin/podman run --replace --name %N --net internal --sdnotify=conmon \
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