[Bug 862076] New: use_lvmetad = 1 in lvm.conf triggers systemd to get into emergency target on boot
https://bugzilla.novell.com/show_bug.cgi?id=862076 https://bugzilla.novell.com/show_bug.cgi?id=862076#c0 Summary: use_lvmetad = 1 in lvm.conf triggers systemd to get into emergency target on boot Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: x86-64 OS/Version: openSUSE 13.1 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: thomas.blume@suse.com ReportedBy: thomas.blume@suse.com QAContact: qa-bugs@suse.de CC: systemd-maintainers@suse.de Found By: Development Services Priority: 1000 Blocker: --- lvm2-2.02.98-0.28.5.1.x86_64 introduced the following change in lvm.conf: - set use_lvmetad = 1 as default of lvm.conf(bnc#854413) This creates a failure on activating non-root lvm mounts. In my test system I'm using lvm devices for /home and /var: [ ***] (1 of 2) A start job is running for dev-nonroot-var.device [** ] (2 of 2) A start job is running for dev-mapper-nonroot\x2dhome.device systemd tries for a while to mount them, then times out and starts the emergency target: Job dev-nonroot-var.device/start finished, result=timeout [ TIME ] Timed out waiting for device dev-nonroot-var.device. Job var.mount/start finished, result=dependency [DEPEND] Dependency failed for /var. Job local-fs.target/start finished, result=dependency [DEPEND] Dependency failed for Local File Systems. Triggering OnFailure= dependencies of local-fs.target. Trying to enqueue job emergency.target/start/replace Installed new job emergency.target/start as 125 Installed new job emergency.service/start as 126 But the emergency target doesn't provide a shell either, it seems to loop somewhere. The reason why the start jobs fail, is apparently that lvmetad is not runnig. I've tried to enable it (it was disabled) via: systemctl enable lvm2-lvmetad.service but it didn't have any effect on the behaviour. As a workaround, one can mount system root via, e.g. the rescue system and set: use_lvmetad = 0 in lvm.conf. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c1
--- Comment #1 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c
Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c3
Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c4
--- Comment #4 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c6
--- Comment #6 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c
Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c8
--- Comment #8 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c9
--- Comment #9 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c11
--- Comment #11 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c12
--- Comment #12 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c13
--- Comment #13 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c14
Andrey Borzenkov
don't know or not sure if having the socket only works.
Yes, it works and is sufficient as long as lvmetad is always connected to via this socket. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c15
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c16
Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c17
--- Comment #17 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c18
--- Comment #18 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c20
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c21
--- Comment #21 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c22
--- Comment #22 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c23
--- Comment #23 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c24
--- Comment #24 from Andrey Borzenkov
Concerning the macro call, I've found that the %service_add_post macro actually strips the suffix from the passed arguments.
Well, this macro really is for migrating from sysvinit to systemd. For pure systemd units on initial install they should be enabled (or not) via call to "systemctl preset" and on updates they should not be touched at all.
-->-- # rpm -q --whatrequires systemd-rpm-macros no package requires systemd-rpm-macros --<--
Seems the lvm2 package is missing this dependency.
This is build time, not run time dependency. lvm2 does not need this package to run, build system needs this package to expand macro during build. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c25
--- Comment #25 from Andrey Borzenkov
I'll beef up patch this week.
See home:arvidjaar:bnc:862076/lvm2, specifically autoactivate-lvmetad-with-generator.patch. With this patch I can set use_lvmetad to 0 and 1 and system boots every time without any need to manually activate lvm2-lvmetad.{socket,service}. It also removes unit from post/preun as it is now redundant. User still can disable lvmetad completely by masking it (systemctl mask lvm2-lvmetad.socket). For upstream we need propagate systemdsystemunitdir into C files (is not done currently). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c26
--- Comment #26 from A R
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c27
dong mao zhang
Concerning the second problem, it should be sufficient to set the global_filter parameter in lvm.conf. For details, see the docu above this parameter:
# Since "filter" is often overriden from command line, it is not suitable # for system-wide device filtering (udev rules, lvmetad). To hide devices # from LVM-specific udev processing and/or from lvmetad, you need to set # global_filter. The syntax is the same as for normal "filter" # above. Devices that fail the global_filter are not even opened by LVM.
But I think it is better to open another bug therefore. This one is about a failure to enable the socket, so no context with the lvmetad device scanning.
I think we could open another bug for this -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c28
--- Comment #28 from Andrey Borzenkov
I think we could open another bug for this
Already done. https://bugzilla.novell.com/show_bug.cgi?id=862403 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c29
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c30
--- Comment #30 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c
Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c31
--- Comment #31 from Robert Milasan
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c32
--- Comment #32 from Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c33
--- Comment #33 from Andrey Borzenkov
@Andrey: How about a submit request from home:arvidjaar:bnc:862076 to update/13.1-test/ ?
How? Which destination (repo etc)?
Do we need this in Factory too?
Yes. SR#222055 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c34
--- Comment #34 from Benjamin Brunner
(In reply to comment #32)
@Andrey: How about a submit request from home:arvidjaar:bnc:862076 to update/13.1-test/ ?
How? Which destination (repo etc)?
A submitrequest doesn't work. Could you open a maintenancerequest for openSUSE:13.1:Update please? (osc mr --incident=2466 home:arvidjaar:bnc:862076 lvm2 openSUSE:13.1:Update) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c35
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c36
--- Comment #36 from Andrey Borzenkov
Could you open a maintenancerequest
MR#222057 (In reply to comment #35)
we'll first see the binary RPMs in the update/13.1-test/ tree.
Ah, well, I was not aware of it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c37
--- Comment #37 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c38
--- Comment #38 from Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c39
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c40
--- Comment #40 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c41
--- Comment #41 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c42
--- Comment #42 from Benjamin Brunner
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c44
--- Comment #44 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c45
--- Comment #45 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c46
--- Comment #46 from Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c47
--- Comment #47 from Andrey Borzenkov
For some reasons lvmetad is stopped
It is not stopped, it is not yet started ... So full story: generator calls lvm_init() which among other things tries to contact lvmetad if it is enabled. When generator is initially called, socket (/run/lvm/lvmetad.socket) does not yet exists so nothing happens here - opening socket fails that's all. And if you do not have any LVM activity after startup, lvmetad is not started as well. When generator is called as part of daemon-reload, socket *does* exist (it is created by systemd) but systemd does not process socket requests until daemon-reload is completed. So we have deadlock here - systemd waits for generator to complete which in turn waits for accept on socket which never comes. Looks like we need to always start both lvmetad.socket and lvmetad.service to ensure lvmetad is running. Which is a pity actually, as the whole point of having socket activation is to avoid running program which is never needed. Is there any more lightweight way to check for use_lvmetad=1? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c48
--- Comment #48 from Thomas Blume
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c49
--- Comment #49 from Andrey Borzenkov
Hm, why not simly checking the config?
lvm dumpconfig | grep use_lvmetad
It does lvm_init() as well. Anyway, it is fixed upstream in commit 983f0b46f2de85b8de0e2d7f8afbdf53f132a87a: lvmetad: Init lazily, to avoid socket access on config overrides. Tested on 13.1. So ... Aller guten Dinge sind drei Factory: SR#223260 13.1: SR#223261 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
Anyway, it is fixed upstream in commit 983f0b46f2de85b8de0e2d7f8afbdf53f132a87a: lvmetad: Init lazily, to avoid socket access on config overrides.
Tested on 13.1.
So ... Aller guten Dinge sind drei
Factory: SR#223260 13.1: SR#223261
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c50
--- Comment #50 from dong mao zhang
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c51
--- Comment #51 from Andrey Borzenkov
If so, do we still need the patch autoactivate-lvmetad-with-generator.patch ?
You are probably right, we can simply always enable lvmetad.socket. It is really easier.
we can 'systemctl enable lvm2-lvmetad.socket' after install.
The problem is there is no way to do it while respecting user (admin) choice. Having [Install] section implies that unit could be disabled so you should not unconditionally enable it in RPM. But if you do not unconditionally enable it, you also cannot unconditionally enable use_lvmetad as you do currently. We are back at square one. I would actually vote for removing [Install] section from lvmetad.socket and simply enabling it statically. For Factory :)
After this patch, systemctl will not hang any more.
Well ... we are at 2.0.98 and since then upstream has several dozens of lvmetad fixes. So I'm not sure if this is really appropriate for 13.1 to make such a huge behavior change. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c52
--- Comment #52 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c53
--- Comment #53 from Benjamin Brunner
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c
dong mao zhang
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c54
dong mao zhang
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c55
Andreas Otto
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c56
--- Comment #56 from Andrey Borzenkov
# systemctl is-enabled lvm2-lvmetad.socket disabled
Please check with "systemctl status". is-enabled just tells, whether links in [Install] section are present; and lvm2-lvmetad.socket is enabled dynamically on boot depending on the value of use_lvmetad. We should either statically enable lvm2-lvmetad.socket or at least remove [Install] section to avoid confusion. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c57
--- Comment #57 from Andreas Otto
https://bugzilla.novell.com/show_bug.cgi?id=862076
https://bugzilla.novell.com/show_bug.cgi?id=862076#c58
--- Comment #58 from Andreas Otto
participants (1)
-
bugzilla_noreply@novell.com