I've created a service for manage some backups of my virtual machines.This service should execute a script when the host is shutting down, and another script when the host start again.My service file have this:[Unit]Description=...After=libvirtd.service[Service]ExecStart=/scripts/check.shExecStop=/scripts/backup.shRemainAfterExit=yesType=oneshot[Install]WantedBy=multi-user.targetNow, my check.sh script Works fine, but my script backup.sh when I reboot or shut down my host, it doesn't work, because my service and libvirtd.service stops at the same time.How can I make my service stops before libvirtd.service?edit:My service will only works if the guest machines are running, so libvirt or something (not libvirt-guests, because I disabled it) is shutting off them.
Systemd stop unit before another unit
systemd