mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
41328342b3
This commit implements three new services, specifically: - The `container-volume` service, which applies to a specific volume name and ensures this exists. This is mainly useful as a dependency to other services, as Podman will create named volumes itself if needed. - The `container-volume-backup` service, which creates a `tar.gz` snapshot of the given volume's contents in `/var/lib/backups`. - The `container-volume-restore` service, which populates an empty volume from a pre-existing file in `/var/lib/backups`, presumably created by `container-volume-backup`. These are then be used to automatically create volume snapshots every 12 hours, rolling over every 7 days.
20 lines
695 B
Desktop File
20 lines
695 B
Desktop File
[Unit]
|
|
Description=Biboumi IRC gateway for XMPP
|
|
Wants=container-build@%N.service container-volume@%N.service prosody.service
|
|
After=container-build@%N.service container-volume@%N.service prosody.service
|
|
|
|
[Service]
|
|
Type=notify
|
|
NotifyAccess=all
|
|
Restart=on-failure
|
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
|
ExecStart=/bin/podman run --replace --pull never --name %N --net internal --sdnotify=conmon \
|
|
--env-file %E/coreos-home-server/%N/%N.env \
|
|
--volume %N:/var/lib/%N:z \
|
|
localhost/%N:latest
|
|
ExecStop=/bin/podman stop --ignore --time 10 %N
|
|
ExecStopPost=/bin/podman rm --ignore --force %N
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|