Comment 25 for bug 1552539

Martin Pitt (pitti) wrote :

I managed to grab a journal with debugging enabled. This shows that a change event for sda3 gets picked up which reactivates the dev-sda3.swap unit and then calls swapon:

Apr 20 13:11:21 ubuntu systemd[1]: dev-sda3.device: Changed dead -> plugged
Apr 20 13:11:21 ubuntu systemd[1]: dev-sda3.swap: Trying to enqueue job dev-sda3.swap/start/fail
Apr 20 13:11:21 ubuntu systemd[1]: dev-sda3.swap: Installed new job dev-sda3.swap/start as 2745
Apr 20 13:11:21 ubuntu systemd[1]: dev-sda3.swap: Enqueued job dev-sda3.swap/start as 2745
Apr 20 13:11:21 ubuntu systemd[1]: dev-sda3.swap: About to execute: /sbin/swapon /dev/sda3

That swapon actually fails in this log because it's busy, but it eventually succeeds.

So this answers *what* is calling swapon. It does not yet answer what exactly happens in between the swapoff and mkswap calls, as doing just those from a shell don't trigger this behaviour. I suppose some uevent is generated in between which triggers the re-activation.