chiark / gitweb /
core/swap: only make configured units part of swap.target
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Oct 2014 04:11:36 +0000 (00:11 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Oct 2014 04:11:36 +0000 (00:11 -0400)
commit3018d31238caabc2e204aa161e647dc1c1b5d1c6
tree1fa3cb71004ae0afdae22ebb1ca28de0e462e043
parentcf4acf84c6304d34108dadd5e87c9a19ca24dceb
core/swap: only make configured units part of swap.target

We used to make all .swap units either RequiredBy=swap.target or
WantedBy=swap.target. But swap.target should be the "configured swap
units", either through /etc/fstab or non-generated .swap units. It
is surprising when systemd starts treating a swap device that was
possibly temporarily enabled as a hard dependency for other units.
So do not add dependencies with swap.target for units gleaned from
/proc/swaps.

Similarly, we added dependencies for all aliases of the device name,
which clutters up the dependency graph but does not seem to bring any
value, since the status of those following units is consistent with
the main one anyway.

This should be a fix for [1], and it seems the right thing to do
anyway.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1114786
src/core/swap.c