Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Martin Pitt
Lennart Poettering [2015-01-28 1:03 +0100]: I implemented a different logic now: http://cgit.freedesktop.org/systemd/systemd/commit/?id=37cf8fee46025d704660a9fc1d1349fe7d0b139d With this change we'll now dispatch only one mkswap per device node, regardless which symlinked alias is used to

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Lennart Poettering
On Wed, 28.01.15 14:16, Martin Pitt (martin.p...@ubuntu.com) wrote: Hey Lennart, Lennart Poettering [2015-01-28 14:06 +0100]: Ah, thanks! That was helpful. I apparently fucked up the new linked list iteration macro I added for this. I think this should make it work:

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Martin Pitt
Hey Lennart, Lennart Poettering [2015-01-28 14:06 +0100]: Ah, thanks! That was helpful. I apparently fucked up the new linked list iteration macro I added for this. I think this should make it work:

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Martin Pitt
Lennart Poettering [2015-01-28 13:15 +0100]: I built a package with this for Debian and Ubuntu. The Debian reporter in https://bugs.debian.org/772182 confirmed that this is working, I think/hope the Ubuntu reporter in https://bugs.launchpad.net/bugs/1399595 is also usually very

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Lennart Poettering
On Wed, 28.01.15 12:37, Martin Pitt (martin.p...@ubuntu.com) wrote: Lennart Poettering [2015-01-28 1:03 +0100]: I implemented a different logic now: http://cgit.freedesktop.org/systemd/systemd/commit/?id=37cf8fee46025d704660a9fc1d1349fe7d0b139d With this change we'll now dispatch

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-28 Thread Lennart Poettering
On Wed, 28.01.15 13:41, Martin Pitt (martin.p...@ubuntu.com) wrote: Lennart Poettering [2015-01-28 13:15 +0100]: I built a package with this for Debian and Ubuntu. The Debian reporter in https://bugs.debian.org/772182 confirmed that this is working, I think/hope the Ubuntu reporter in

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Lennart Poettering
On Tue, 27.01.15 23:31, Lennart Poettering (lenn...@poettering.net) wrote: On Fri, 23.01.15 10:18, Martin Pitt (martin.p...@ubuntu.com) wrote: So perhaps the more robust fix would be to make the gpt generator not generate swap units if fstab already configures any swap device? I. e.

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Jóhann B. Guðmundsson
On 01/28/2015 12:24 AM, Lennart Poettering wrote: On Tue, 27.01.15 17:17, Chris Murphy (li...@colorremedies.com) wrote: The problem is simply that we cannot know in advance that /dev/sda7 and /dev/disk/by-uuid/c0e7978b-f82b-4b7f-b72b-6717f6909abc will eventually refer to the same device.

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Chris Murphy
On Tue, Jan 27, 2015 at 5:28 PM, Jóhann B. Guðmundsson johan...@gmail.com wrote: On 01/28/2015 12:24 AM, Lennart Poettering wrote: On Tue, 27.01.15 17:17, Chris Murphy (li...@colorremedies.com) wrote: The problem is simply that we cannot know in advance that /dev/sda7 and

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Jóhann B. Guðmundsson
On 01/27/2015 10:48 PM, Lennart Poettering wrote: Another idea might be to simply accept that activating the swap by two names at the same time can happen concurrently, and teach mkswap in some way to handle this gracefully. For example, mkswap could learn a new switch --idempotent or so,

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Lennart Poettering
On Tue, 27.01.15 23:48, Lennart Poettering (lenn...@poettering.net) wrote: That said, it would of course be nicer if we wouldn't have to serialize here... Another idea might be to simply accept that activating the swap by two names at the same time can happen concurrently, and teach

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Lennart Poettering
On Tue, 27.01.15 23:40, Lennart Poettering (lenn...@poettering.net) wrote: On Tue, 27.01.15 23:31, Lennart Poettering (lenn...@poettering.net) wrote: On Fri, 23.01.15 10:18, Martin Pitt (martin.p...@ubuntu.com) wrote: So perhaps the more robust fix would be to make the gpt generator

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Lennart Poettering
On Tue, 27.01.15 23:29, Jóhann B. Guðmundsson (johan...@gmail.com) wrote: On 01/27/2015 10:48 PM, Lennart Poettering wrote: Another idea might be to simply accept that activating the swap by two names at the same time can happen concurrently, and teach mkswap in some way to handle this

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Chris Murphy
On Tue, Jan 27, 2015 at 5:05 PM, Lennart Poettering lenn...@poettering.net wrote: On Tue, 27.01.15 23:29, Jóhann B. Guðmundsson (johan...@gmail.com) wrote: On 01/27/2015 10:48 PM, Lennart Poettering wrote: Another idea might be to simply accept that activating the swap by two names at the

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Lennart Poettering
On Fri, 23.01.15 10:18, Martin Pitt (martin.p...@ubuntu.com) wrote: So perhaps the more robust fix would be to make the gpt generator not generate swap units if fstab already configures any swap device? I. e. auto-discovery and swaps in fstab are mutually exclusive then. Hmm, so there's

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Jan 26, 2015 at 10:08:02AM +0100, Martin Pitt wrote: Peter Mattern [2015-01-23 14:03 +0100]: According to man (http://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html, see section Description) systemd-gpt-auto-generator is supposed to behave like this by

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Chris Murphy
On Tue, Jan 27, 2015 at 8:19 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: You also need swap if you want to use all of your memory. If you have no swap, allocating close to 100% RAM becomes very dangerous, because any overflow will result in oom. Yes that makes sense too. Maybe

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Jan 27, 2015 at 10:25:32PM -0700, Chris Murphy wrote: On Tue, Jan 27, 2015 at 8:19 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: You also need swap if you want to use all of your memory. If you have no swap, allocating close to 100% RAM becomes very dangerous, because

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-27 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Jan 27, 2015 at 05:47:07PM -0700, Chris Murphy wrote: On Tue, Jan 27, 2015 at 5:28 PM, Jóhann B. Guðmundsson johan...@gmail.com wrote: On 01/28/2015 12:24 AM, Lennart Poettering wrote: On Tue, 27.01.15 17:17, Chris Murphy (li...@colorremedies.com) wrote: The problem is

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-26 Thread Martin Pitt
Peter Mattern [2015-01-23 14:03 +0100]: According to man (http://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html, see section Description) systemd-gpt-auto-generator is supposed to behave like this by now already. Supposed yes, but I don't see anything in

[systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-23 Thread Martin Pitt
Hello all, we just received a report (https://launchpad.net/bugs/1399595) that swap gets activated twice: | systemd[1]: Activating swap Swap Partition... | systemd[1]: Activating swap /dev/disk/by-uuid/73d341f1-eedc-43fc-9e53-ba4194dae3fb... | swapon[396]: swapon:

Re: [systemd-devel] Swap gets activated twice (through fstab and gpt generators)

2015-01-23 Thread Peter Mattern
I saw this on an Arch Linux (systemd 218) i686 QEMU VM using BIOS and GPT, too. Couldn't see it on another x86_64 VM using UEFI (TianoCore / OVMF) and GPT but configured exactly the same apart from this. Lenovo's Yoga 2 Pro used by the said bug report's OP is featuring a BIOS, too. So