Bug 81361

Summary: If swap is enabled in fstab and the admin has run swapoff, swap gets automatically remounted
Product: systemd Reporter: jhernberg
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: jhernberg
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: systemd debug log to show what happens

Description jhernberg 2014-07-14 20:13:34 UTC
Created attachment 102799 [details]
systemd debug log to show what happens

If swap gets enabled in fstab, and consequently gets unmounted by the admin using swapoff, at some unspecified future point in time it will be remounted by systemd.

Steps to reproduce:
1. Boot with swap enabled in /etc/fstab
2. Run swapoff -all
3. Run swapon --show (to verify that swap is disabled)
4. Run systemctl daemon-reload
5. Run swapon --show (to show that swap got enabled)
Comment 1 jhernberg 2014-07-14 22:47:34 UTC
To be more specific, when I say enabling swap in fstab, i mean mounting a device to swap.  Don't know if the same problem occurs with a swap file.
Comment 2 Zbigniew Jedrzejewski-Szmek 2014-10-04 15:34:23 UTC
Behaviour changed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=3018d31238. Swaps do not get reenabled in the sequence of commands you describe. If will get reenabled though, if you stop and start swap.target explicitly. But I guess that this is OK.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.