I am using systemd timers to schedule backup runs. Mails sent after backup never arrive, presumably because:
- backup software invokes
mail
mail invokes dma (as sendmail)
dma daemon()izes after writing the queue file, effectively exiting dma from the view of mail
mail and subsequently backup software exit
- systemd sees the backup process exit and then kills the cgroup
dma is killed, the queue file stays in place and never gets delivered
I am not sure how to generically fix this. One option would be to have a systemd unit that gets triggered on a socket, running a dma -q. If this socket is active, then dma would terminate instead of trying to deliver itself. Of course this requires installing and activating a systemd unit, but I don't see how we could do it without.
Seeking comments.