Bug 851741

Summary: lvm2 systemd incorrectly uses dependencies on Fedora services (fedora-storage-init.service fedora-storage-init-late.service)
Product: [openSUSE] openSUSE 13.1 Reporter: Forgotten User o5N6HWuMhD <forgotten_o5N6HWuMhD>
Component: BasesystemAssignee: Dong Mao Zhang <dmzhang>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: arvidjaar
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 13.1   
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User o5N6HWuMhD 2013-11-22 05:36:54 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0

upgrade of working 12.3 servers with /boot on RAID & other parts on LVM-on-RAID, to 13.1,

	lsb_release -rd
		Description:    openSUSE 13.1 (Bottle) (x86_64)
		Release:        13.1

no longer boot, hanging hard at

	[  OK  ] Reached target Encrypted Volumes.
	         Starting Activation of LVM2 logical volumes...
	[  OK  ] Started Activation of LVM2 logical volumes.
	[ TIME ] Timed out waiting for device dev-disk-by\x2did-md\x2...c30fbff.device.
	[DEPEND] Dependency failed for /boot.
	[DEPEND] Dependency failed for Local File Systems.

on 12.3

	lsb_release -rd
		Description:    openSUSE 12.3 (x86_64)
		Release:        12.3

lvm2 was called from

	grep -rlni lvm2 /etc/init.d
		/etc/init.d/boot.lvm

but on 13.1, it's handled by systemd units,

checking

	rpm -q --whatprovides /usr/lib/systemd/system/lvm2-monitor.service
		lvm2-2.02.98-0.28.1.5.x86_64

in the service file,

	cat /usr/lib/systemd/system/lvm2-monitor.service 
		[Unit]
		Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
		Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8)
		Requires=dm-event.socket
		After=dm-event.socket fedora-storage-init.service fedora-storage-init-late.service lvm2-activation.service lvm2-lvmetad.service
		Before=local-fs.target
		DefaultDependencies=no
		Conflicts=shutdown.target

		[Service]
		Type=oneshot
		Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
		ExecStart=/sbin/lvm vgchange --monitor y
		ExecStop=/sbin/lvm vgchange --monitor n
		RemainAfterExit=yes

		[Install]
		WantedBy=sysinit.target

note the incorrect After= dependency on

	fedora-storage-init.service
	fedora-storage-init-late.service

guessing it was simply copied from Fedora without checking/testing the euqivalent Opensuse deps.

I'm not clear what the right deps in Opensuse 13.1 SHOULD be -- other than NOT *fedora* ...

good news, looks like it's the only one,

	grep -rlni fedora /usr/lib/systemd/system/
		/usr/lib/systemd/system/lvm2-monitor.service



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Forgotten User o5N6HWuMhD 2013-11-22 07:45:18 UTC
Looking at systemd units, looks like a combination of udev & raid (dm/md) service dependencies -- and, perhaps system.init? -- need to be added.

dependency order needs to accommodate both LVM-on-RAID, and RAID-on-LVM.

poking around to see what/how.
Comment 2 Forgotten User o5N6HWuMhD 2013-11-22 07:49:48 UTC
fwiw, upgrades of 12.3 -> 13.1 with /boot + other-on-LVM -- *NO* RAID, boot without issue.

so far, the 'problem boxes' all have raid in the mix.
Comment 3 Forgotten User o5N6HWuMhD 2013-11-22 19:35:40 UTC
@nfbrown,

does this look like an mdadm 3.3 - related issue to you?
Comment 4 Forgotten User o5N6HWuMhD 2013-11-22 20:27:17 UTC
fyi, from

https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/492403-server-upgraded-12-3-13-1-lvm-raid-fails-boot-timeout-waiting-boot-device.html#post2600471

bit more detail re: hang at an LVM2/Dbus timeout waiting for the /boot device that's on RAID:

http://pastebin.com/KcNPriuV
Comment 5 Forgotten User o5N6HWuMhD 2013-11-22 22:28:32 UTC
this may be relevant:

Bug 849752 - 13.1RC2 Cannot boot from RAID1 volume(s)
https://bugzilla.novell.com/show_bug.cgi?id=849752#c9
Comment 6 Forgotten User o5N6HWuMhD 2013-11-22 22:28:56 UTC
this may be relevant:

Bug 849752 - 13.1RC2 Cannot boot from RAID1 volume(s)
https://bugzilla.novell.com/show_bug.cgi?id=849752#c9
Comment 7 Forgotten User o5N6HWuMhD 2013-11-23 17:51:59 UTC
I suspect there may be two issues here,

(1) the lvm2 unit's references to *fedora
(2) hang @ boot when /boot is on RAID

leaving (1) here, splitting off (2) to:

https://bugzilla.novell.com/show_bug.cgi?id=851993
Comment 8 Andrei Borzenkov 2013-11-23 19:48:13 UTC
(In reply to comment #7)
> (1) the lvm2 unit's references to *fedora

Ordering dependency on non-existent unit is noop. This is just minor cosmetic issue at most which probably is not worth extra patch to maintain.
Comment 9 Forgotten User o5N6HWuMhD 2013-11-24 16:14:35 UTC
Re: noop on non-existent, understood.

But those Fedora units imply SOME sort of dependency -- in Fedora-land.

Is there an equivalent required dependency in Opensuse-land?  SPecifically, which -- if any -- units in Opensuse are dealing with the same startup deps as:

    fedora-storage-init.service
    fedora-storage-init-late.service

and do they need to be included?
Comment 10 Andrei Borzenkov 2013-11-24 16:46:26 UTC
(In reply to comment #9)
> 
> Is there an equivalent required dependency in Opensuse-land?

lvm2-monitor.service just starts monitoring, which is optional anyway. If it is started it is ordered after lvm2-activation.service which does the real job. lvm2-activation.service is generated dynamically based on actual lvm.conf.
Comment 11 Dong Mao Zhang 2013-11-26 09:09:08 UTC
The upstream code has commits 360c569ce8f0bfe936d59ca91de2716958550524 to remove this deps..
Comment 12 Bernhard Wiedemann 2014-01-16 11:00:17 UTC
This is an autogenerated message for OBS integration:
This bug (851741) was mentioned in
https://build.opensuse.org/request/show/214084 Factory / lvm2
Comment 13 Swamp Workflow Management 2014-02-03 15:31:19 UTC
openSUSE-RU-2014:0186-1: An update that has 5 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 779965,837954,851741,854076,854413
CVE References: 
Sources used:
openSUSE 13.1 (src):    lvm2-2.02.98-0.28.5.1
Comment 14 Benjamin Brunner 2014-03-03 09:31:34 UTC
Update released for openSUSE 13.1. Resolved fixed.