Hi, systemd runs swapoff on shutdown, but unfortunately another step is needed for NBD swap:
# nbd-client -d /dev/nbd1

This notifies the server that the client is shutting down, and thus the nbd-server process is terminated, the swap file is erased etc.

In order to work around that issue, I'm trying to create a systemd service that
1) Runs on shutdown:
WantedBy=shutdown.target
2) Runs before `swapoff` and before the network gets down:
After=swap.target network.target
3) And at that time, it calls a script that calls swapoff itself, and then nbd-client -d:
ExecStart=/path/to/my-nbd-disconnect-script

It's not called at all though when I'm running `poweroff`. What am I doing wrong? How can I invoke `nbd-client -d` on shutdown, but before the swap gets off and while the network is still up?

Thank you,
Alkis Georgopoulos
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to