Replace ExecStop with ExecStopPost
ExecStopPost should allow us to clean up (docker kill + docker rm) even if the ExecStart (docker run ..) command failed, and not just after a graceful service stop was initiated. Source: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStopPost=
This commit is contained in:
@ -21,8 +21,8 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-postgres-backu
|
||||
--mount type=bind,src={{ matrix_postgres_backup_path }},dst=/backups \
|
||||
{{ matrix_postgres_backup_docker_image_to_use }}
|
||||
|
||||
ExecStop=-{{ matrix_host_command_docker }} stop matrix-postgres-backup
|
||||
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-postgres-backup 2>/dev/null'
|
||||
ExecStopPost=-{{ matrix_host_command_docker }} stop matrix-postgres-backup
|
||||
ExecStopPost=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-postgres-backup 2>/dev/null'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-postgres-backup
|
||||
|
Reference in New Issue
Block a user