[systemd-devel] [PATCH RFC] swap: use aliases to group swap units for same device

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Oct 23 09:52:02 PDT 2012


On Tue, Oct 23, 2012 at 05:48:57PM +0200, Kay Sievers wrote:
> On Tue, Oct 23, 2012 at 5:34 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Fri, 19.10.12 00:56, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> >
> >> A series of .swap units "following" one another are replaced with a
> >> single unit with multiple names.
> >>
> >> The idea is to simplify things for the user: only one swap unit per
> >> swap area. It shouldn't matter whether the swap area was activated by
> >> systemd or by direct swapon invocation. The kernel name (from
> >> /proc/swaps) is preferred, but if swap is configured through a unit
> >> file and not active, that name will be used instead.
> >>
> >> The case where a swap unit refers (What=) to a symlink should behave
> >> better than before.
> >>
> >> Note: this patch is goes on top of some cleanup patches that are
> >> pretty boring and thus I'm not posting them, so it might not apply
> >> cleanly.
> >
> > So here's the reason why we use the "following" scheme for htis, rather
> > than just alias names. And that's simply because a name in /dev can
> > refer to different things during runtime and we cannot model this with
> > aliases.
[snip]

OK, that makes sense. Thank you both for the explanation.

So, back to square one: should the user be presented with one swap "device"
for every name the device can be found under? I think it makes for a crappy
interface, because it is hard to distinguish (without actually checking),
which .swap units refer to the same thing.

One option would be to only show the "main" unit in systemctl listings,
and hide all "following" units. But this creates units which are "hidden",
so probably not a good idea.

Maybe it is enough to change the DESCRIPTION to show the same thing
(e.g. the name the kernel uses)?

Zbyszek


More information about the systemd-devel mailing list