Bug 8399 - ConnMan service modified to unconditionally start a program that doesn't exist for most use cases
Summary: ConnMan service modified to unconditionally start a program that doesn't exis...
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: connectivity (show other bugs)
Version: 1.9
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.1 M2
Assignee: Joshua Lock
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-09-25 15:41 UTC by Joshua Lock
Modified: 2016-02-17 15:53 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Lock 2015-09-25 15:41:25 UTC
Analysing the journal of a custom distro running on target hardware I spotted:

connman.service: Failed at step EXEC spawning /usr/lib/connman/wired-setup: No such file or directory

Having done some digging I have discovered that wired-setup is a script from the connman-conf recipe that helps set up qemu machines running on the autobuilder, however the script is unconditionally inserted as an ExecPre for all targets.

This means anyone building a systemd based OS with Yocto/OE Core gets this error for free unless they replace/modify the connman service.

I think the default stance should be to ship metadata which is usable without errors for the use case of building an OS to run on target hardware, rather than the metadata being built to support the autobuilder use case first and foremost.

Rather than hack the connman.service file to have an ExecPre couldn't the connman-conf recipe provide its own unit which uses the Before= option to ensure it's started before connman?
Comment 1 Ross Burton 2015-09-25 15:53:11 UTC
Yes, that's an excellent idea.
Comment 3 Joshua Lock 2015-10-14 10:22:01 UTC
RFC patch series submitted http://lists.openembedded.org/pipermail/openembedded-core/2015-October/111536.html
Comment 4 Joshua Lock 2015-12-10 09:03:22 UTC
v3 of the series, to address various review comments, has been submitted:

http://lists.openembedded.org/pipermail/openembedded-core/2015-December/113933.html
Comment 5 Joshua Lock 2015-12-16 20:44:18 UTC
Simpler v4 series posted based on feedback from Martin:
http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114241.html
Comment 7 Daniel Istrate 2016-02-17 15:53:09 UTC
Verified on master: 152914f2983c5d69001de1d46ce99547fa1e75fe


Steps:
1. test that qemu machines continue to work as before
root@qemux86-64:~# journalctl | grep connman
Feb 17 14:41:56 qemux86-64 connmand[422]: Connection Manager version 1.31
Feb 17 14:41:56 qemux86-64 connmand[422]: Adding configuration wired
Feb 17 14:41:56 qemux86-64 connmand[422]: Checking loopback interface settings
Feb 17 14:41:56 qemux86-64 connmand[422]: System hostname is qemux86-64
Feb 17 14:41:57 qemux86-64 connmand[422]: lo {newlink} index 1 address 00:00:00:00:00:00 mtu 65536
Feb 17 14:41:57 qemux86-64 connmand[422]: lo {newlink} index 1 operstate 0 <UNKNOWN>
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {create} index 2 type 1 <ETHER>
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {RX} 32 packets 5573 bytes
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {TX} 29 packets 4759 bytes
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {update} flags 69699 <UP,RUNNING,LOWER_UP>
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {newlink} index 2 address 52:54:00:12:34:56 mtu 1500
Feb 17 14:41:57 qemux86-64 connmand[422]: eth0 {newlink} index 2 operstate 6 <UP>
Feb 17 14:41:58 qemux86-64 connmand[422]: Skipping disconnect of carrier, network is connecting.
Feb 17 14:41:59 qemux86-64 connmand[422]: Adding interface eth0 [ ethernet ]
Feb 17 14:41:59 qemux86-64 connmand[422]: sit0 {newlink} index 3 address 00:00:00:00:08:00 mtu 1480
Feb 17 14:41:59 qemux86-64 connmand[422]: sit0 {newlink} index 3 operstate 2 <DOWN>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} address 192.168.7.2/24 label eth0 family 2
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 192.168.7.1 gw 0.0.0.0 scope 253 <LINK>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 8.8.8.8 gw 192.168.7.1 scope 0 <UNIVERSE>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 0.0.0.0 gw 192.168.7.1 scope 0 <UNIVERSE>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 8.8.8.8 gw 192.168.7.1 scope 0 <UNIVERSE>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 192.168.7.0 gw 0.0.0.0 scope 253 <LINK>
Feb 17 14:41:59 qemux86-64 connmand[422]: eth0 {add} route 192.168.7.1 gw 0.0.0.0 scope 253 <LINK>
Feb 17 14:42:04 qemux86-64 connmand[422]: Online check failed for 0x726100 Wired

2. test that non-qemu machines no longer unconditionally try to run that script
Feb 17 15:34:21 genericx86-64 connmand[457]: Connection Manager version 1.31
Feb 17 15:34:21 genericx86-64 connmand[457]: Checking loopback interface settings
Feb 17 15:34:21 genericx86-64 connmand[457]: System hostname is genericx86-64
Feb 17 15:34:21 genericx86-64 connmand[457]: lo {newlink} index 1 address 00:00:00:00:00:00 mtu 65536
Feb 17 15:34:21 genericx86-64 connmand[457]: lo {newlink} index 1 operstate 0 <UNKNOWN>
Feb 17 15:34:21 genericx86-64 connmand[457]: eno1 {create} index 2 type 1 <ETHER>
Feb 17 15:34:21 genericx86-64 connmand[457]: eno1 {update} flags 4098 <DOWN>
Feb 17 15:34:21 genericx86-64 connmand[457]: eno1 {newlink} index 2 address C0:3F:D5:69:19:C7 mtu 1500
Feb 17 15:34:21 genericx86-64 connmand[457]: eno1 {newlink} index 2 operstate 2 <DOWN>
Feb 17 15:34:22 genericx86-64 connmand[457]: Adding interface eno1 [ ethernet ]
Feb 17 15:34:22 genericx86-64 connmand[457]: sit0 {newlink} index 3 address 00:00:00:00:08:00 mtu 1480
Feb 17 15:34:22 genericx86-64 connmand[457]: sit0 {newlink} index 3 operstate 2 <DOWN>
Feb 17 15:34:22 genericx86-64 connmand[457]: eno1 {update} flags 36867 <UP>
Feb 17 15:34:22 genericx86-64 connmand[457]: eno1 {newlink} index 2 address C0:3F:D5:69:19:C7 mtu 1500
Feb 17 15:34:22 genericx86-64 connmand[457]: eno1 {newlink} index 2 operstate 2 <DOWN>
Feb 17 15:34:25 genericx86-64 connmand[457]: eno1 {add} route ff00:: gw :: scope 0 <UNIVERSE>
Feb 17 15:34:25 genericx86-64 connmand[457]: eno1 {add} route fe80:: gw :: scope 0 <UNIVERSE>
Feb 17 15:34:25 genericx86-64 connmand[457]: eno1 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Feb 17 15:34:25 genericx86-64 connmand[457]: eno1 {newlink} index 2 address C0:3F:D5:69:19:C7 mtu 1500
Feb 17 15:34:25 genericx86-64 connmand[457]: eno1 {newlink} index 2 operstate 6 <UP>
Feb 17 15:34:25 genericx86-64 connmand[457]: Skipping disconnect of carrier, network is connecting.
Feb 17 15:35:04 genericx86-64 connmand[457]: eno1 {add} address 169.254.15.204/16 label eno1 family 2
Feb 17 15:35:04 genericx86-64 connmand[457]: eno1 {add} route 169.254.0.0 gw 0.0.0.0 scope 253 <LINK>
Feb 17 15:35:04 genericx86-64 connmand[457]: eno1 {add} route 0.0.0.0 gw 0.0.0.0 scope 253 <LINK>

No connman errors.

Also the eth0 device on the QEMU machine has values matching http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config and that eth0 on the non-qemu machine doesn't:
NUC:  eno1      Link encap:Ethernet  HWaddr C0:3F:D5:69:19:C7 
qemu: eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56