Bug 809646

Summary: systemd fails to handle the dependencies for LSB scripts
Product: [openSUSE] openSUSE 12.3 Reporter: Dieter Bloms <dieter>
Component: BasesystemAssignee: Frederic Crozat <fcrozat>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: fcrozat, jfehlig, meissner, per
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: dmesg after boot with debug enable
output of the command "systemctl status xencommons.service"
output of "systemctl show xencommons.service"
output of "systemctl status xendomains.service"
output of "systemctl show xendomains.service"

Description Dieter Bloms 2013-03-15 15:06:41 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22

I use opensuse 12.3, but I can't select it in the operating system box.
I use opensuse 12.3 as dom0 and the startscript xendomains depends on xenstored, which is provided by xencommons.
When I boot my system the xendomains script is executed before xencommons has finished. For me it looks like a bug in systemd, because xendomains should only be started, when xencommons is finished.

This is not a XEN bug in my eyes!

Here a snip of my log files, where you can see, that xendomains is started an 16:34:27 and xencommons (which provides xenstored) is finished at 16:34:30:

--snip--
2013-03-14T16:34:27.481310+01:00 xen xendomains[737]: Starting auto Xen domains
2013-03-14T16:34:27.501932+01:00 xen kernel: [   13.677948] pciback 0000:02:00.0: seizing device
2013-03-14T16:34:27.541912+01:00 xen kernel: [   13.716108] pciback: backend is vpci
2013-03-14T16:34:27.549890+01:00 xen xendomains[737]: 01gateway: libxl: error: libxl.c:87:libxl_ctx_alloc: Is xenstore daemon running?
2013-03-14T16:34:27.551241+01:00 xen xendomains[737]: failed to stat /var/run/xenstored.pid: No such file or directory
2013-03-14T16:34:27.551494+01:00 xen xendomains[737]: cannot init xl context
2013-03-14T16:34:27.569904+01:00 xen kernel: [   13.746993] blktap_device_init: blktap device major 252
2013-03-14T16:34:27.569938+01:00 xen kernel: [   13.747007] blktap_ring_init: blktap ring major: 251
2013-03-14T16:34:27.581928+01:00 xen xendomains[737]: libxl: error: libxl.c:87:libxl_ctx_alloc: Is xenstore daemon running?
2013-03-14T16:34:27.584768+01:00 xen xendomains[737]: failed to stat /var/run/xenstored.pid: No such file or directory
2013-03-14T16:34:27.585035+01:00 xen xendomains[737]: cannot init xl context
2013-03-14T16:34:27.588725+01:00 xen xendomains[737]: ..failed
2013-03-14T16:34:27.621915+01:00 xen kernel: [   13.797019] nbd: registered device at major 43
2013-03-14T16:34:27.665693+01:00 xen xendomains[737]: 02appserver: libxl: error: libxl.c:87:libxl_ctx_alloc: Is xenstore daemon running?
2013-03-14T16:34:27.665752+01:00 xen xendomains[737]: failed to stat /var/run/xenstored.pid: No such file or directory
2013-03-14T16:34:27.665771+01:00 xen xendomains[737]: cannot init xl context
2013-03-14T16:34:27.703149+01:00 xen xendomains[737]: libxl: error: libxl.c:87:libxl_ctx_alloc: Is xenstore daemon running?
2013-03-14T16:34:27.704894+01:00 xen xendomains[737]: failed to stat /var/run/xenstored.pid: No such file or directory
2013-03-14T16:34:27.705269+01:00 xen xendomains[737]: cannot init xl context
2013-03-14T16:34:27.708517+01:00 xen xendomains[737]: ..failed
2013-03-14T16:34:27.718325+01:00 xen xenstored: Checking store ...
2013-03-14T16:34:27.815521+01:00 xen xenstored: Checking store complete.
2013-03-14T16:34:27.822758+01:00 xen xencommons[736]: Starting C xenstored...
2013-03-14T16:34:27.824299+01:00 xen xencommons[736]: Setting domain 0 name...
2013-03-14T16:34:27.841961+01:00 xen kernel: [   14.019412] Unable to read sysrq code in control/sysrq
2013-03-14T16:34:27.843873+01:00 xen xencommons[736]: Starting xenconsoled...
2013-03-14T16:34:27.867333+01:00 xen xencommons[736]: Starting QEMU as disk backend for dom0
2013-03-14T16:34:29.706697+01:00 xen network[697]: Setting up network interfaces:
2013-03-14T16:34:30.251881+01:00 xen network[697]: lo
2013-03-14T16:34:30.257606+01:00 xen ifup[1338]:     lo
2013-03-14T16:34:30.392449+01:00 xen ifup[1338]:     lo
2013-03-14T16:34:30.405255+01:00 xen ifup[1338]: IP address: 127.0.0.1/8
2013-03-14T16:34:30.407941+01:00 xen network[697]: lo        IP address: 127.0.0.1/8
2013-03-14T16:34:30.415491+01:00 xen ifup[1338]:
2013-03-14T16:34:30.583589+01:00 xen systemd[1]: Started LSB: Start/stop xenstored and xenconsoled.
--snip--

Reproducible: Always

Steps to Reproduce:
installed opensuse 12.3 minimal (Textconsole) then install the xen packages.
Enable xencommons and xendomains, reboot the system and you will see, that xendomains will be executed vefore xencommons hasn't finished.
Actual Results:  
The first 2-3 domUs will not be started

Expected Results:  
All domUs should be started
Comment 1 Frederic Crozat 2013-03-15 16:27:44 UTC
please give the output of :
systemctl status xencommons.service
systemctl show xencommons.service
systemctl status xendomains.service
systemctl show xendomains.service

and if you can, boot with systemd.log_level=debug systemd.log_target=kmsg and attach dmesg output
Comment 2 Dieter Bloms 2013-03-16 19:20:13 UTC
Created attachment 530048 [details]
dmesg after boot with debug enable
Comment 3 Dieter Bloms 2013-03-16 19:21:28 UTC
Created attachment 530049 [details]
output of the command "systemctl status xencommons.service"
Comment 4 Dieter Bloms 2013-03-16 19:21:59 UTC
Created attachment 530050 [details]
output of "systemctl show xencommons.service"
Comment 5 Dieter Bloms 2013-03-16 19:22:33 UTC
Created attachment 530051 [details]
output of "systemctl status xendomains.service"
Comment 6 Dieter Bloms 2013-03-16 19:23:06 UTC
Created attachment 530052 [details]
output of "systemctl show xendomains.service"
Comment 7 Frederic Crozat 2013-03-18 09:41:02 UTC
In the systemd log:
[    6.739448] systemd[1]: [/etc/init.d/xencommons:10] Failed to add LSB Provides name xenstored.service, ignoring: File exists
[    6.739699] systemd[1]: [/etc/init.d/xencommons:10] Failed to add LSB Provides name xenconsoled.service, ignoring: File exists

This looks like a systemd bug (I'll look into it), but to workaround it, I would suggest to:
- in /etc/init.d/xencommons, replace:
# Provides: xenstored xenconsoled
by
# Provides: xencommons xenstored xenconsoled

- in /etc/init.d/xendomains, replace:
# Required-Start: $syslog $remote_fs xenstored xenconsoled
# Required-Stop: $syslog $remote_fs xenstored xenconsoled
by
# Required-Start: $syslog $remote_fs xencommons
# Required-Stop: $syslog $remote_fs xencommons
Comment 8 Dieter Bloms 2013-03-18 14:39:58 UTC
yes, the workaround helps me for now.
Comment 9 Frederic Crozat 2013-03-21 16:39:48 UTC
Fix for systemd is available at http://download.opensuse.org/repositories/home:/fcrozat:/branches:/openSUSE:/12.3:/Update/standard/
Comment 10 Frederic Crozat 2013-04-08 14:30:20 UTC
mr 163177 submitted
Comment 11 Marcus Meissner 2013-04-08 14:55:00 UTC
accepted
Comment 12 Bernhard Wiedemann 2013-04-08 15:00:35 UTC
This is an autogenerated message for OBS integration:
This bug (809646) was mentioned in
https://build.opensuse.org/request/show/163178 Maintenance /
Comment 13 Bernhard Wiedemann 2013-04-11 11:00:40 UTC
This is an autogenerated message for OBS integration:
This bug (809646) was mentioned in
https://build.opensuse.org/request/show/163605 Factory / systemd
Comment 14 Bernhard Wiedemann 2013-04-19 13:00:38 UTC
This is an autogenerated message for OBS integration:
This bug (809646) was mentioned in
https://build.opensuse.org/request/show/172486 Maintenance /
Comment 15 Benjamin Brunner 2013-05-02 12:43:27 UTC
Update released for openSUSE 12.3. Resolved fixed.
Comment 16 Swamp Workflow Management 2013-06-10 09:07:38 UTC
openSUSE-RU-2013:0877-1: An update that has 8 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 746595,789589,801878,808319,809646,809695,809820,812874
CVE References: 
Sources used:
openSUSE 12.3 (src):    systemd-195-13.25.1, systemd-mini-195-13.25.1