Piggy-backing off this thread:
https://forum.proxmox.com/threads/p...il-server-is-not-available.108893/post-495825
How should I set up the dependencies for a systemd service to ensure mail delivery during startup & shutdown of the system? From the thread linked above, I'll need to consider the cluster file system (pve-cluster.service). Any others?
For a concrete example, here's a service that invokes a script that sends mail. I want this to be able to send a mail both during shutdown and startup of the system.
https://forum.proxmox.com/threads/p...il-server-is-not-available.108893/post-495825
How should I set up the dependencies for a systemd service to ensure mail delivery during startup & shutdown of the system? From the thread linked above, I'll need to consider the cluster file system (pve-cluster.service). Any others?
For a concrete example, here's a service that invokes a script that sends mail. I want this to be able to send a mail both during shutdown and startup of the system.
Code:
[Unit]
Description=Send email at system Start and Stop
Wants=postfix.service
After=postfix.service pve-cluster.service
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/sbin/bootmail.sh startup
ExecStop=/usr/local/sbin/bootmail.sh shutdown
[Install]
WantedBy=multi-user.target