Bug 1001834

Summary: mediatomb could not find Ethernet interface at system startup
Product: [Fedora] Fedora Reporter: Jürgen <juergen.stohr>
Component: mediatombAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: gwync
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mediatomb-0.12.1-31.fc18.20120403gitb66dc1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-07 01:24:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jürgen 2013-08-27 21:29:32 UTC
Description of problem:
If mediatomb is enabled via systemctl and started automatically at system boot, there might be a race condition between the NetworkManager and mediatomb. Sometimes when the system is started, mediatomb fails with the messages:

ERROR: Could not determine interface address: Cannot assign requested address
ERROR: Could not find interface: em1

When doing a "systemctl restart mediatomb.service", mediatomb starts normally.

Version-Release number of selected component (if applicable):
mediatomb-0.12.1-29.fc19.20120403gitb66dc1.x86_64

How reproducible:
On my machine, mediatomb does not start in 9 of 10 times. It depends on how fast the NetworkManager is able to activate the Ethernet interface.

Actual results:
I managed to fix the problem by changing the file
/usr/lib/systemd/system/mediatomb.service. Here, the "After" statement has to be modified:
< After=network.target
> After=NetworkManager-wait-online.service
In addition, the NetworkManager-wait-online.service has to be enabled:
systemctl enable NetworkManager-wait-online.service

Additional info:
If mediatomb is enabled in the original configuration on my machine, the Ethernet interface is generally not enabled at system startup by the Network Manager. In /var/log/messages the following messages appear:
NetworkManager[752]: <warn> (em1): device not up after timeout!
NetworkManager[752]: <info> (em1): deactivating device (reason 'managed') 
The Ethernet interface comes up normally at system startup, if mediatomb is not enabled or mediatomb.service is modified as described above.

Comment 1 Gwyn Ciesla 2013-08-28 13:09:55 UTC
Instead of NetworkManager-wait-online.service, does network-online.target work, which seems to be enabled by default?

Comment 2 Jürgen 2013-08-29 13:44:32 UTC
(In reply to Jon Ciesla from comment #1)
> Instead of NetworkManager-wait-online.service, does network-online.target
> work, which seems to be enabled by default?

No, it does not work.
Changing the line from
"After=NetworkManager-wait-online.service" to "After=network-online.target" results in the error messages "ERROR: Could not determine interface address: Cannot assign requested address, ERROR: Could not find interface: em1"
However, I am not sure if network-online.target is really used on my system. I'm using a fresh fc19 installation. The command "systemctl | grep network" only delivers "network.target              loaded active active    Network"

Comment 3 Gwyn Ciesla 2013-08-29 14:10:59 UTC
Hmm.  What if you have both After= lines in place?  That way it could work whether people are using NetworkManager or the older network service.

Comment 4 Jürgen 2013-08-29 14:39:46 UTC
(In reply to Jon Ciesla from comment #3)
> Hmm.  What if you have both After= lines in place?  That way it could work
> whether people are using NetworkManager or the older network service.

If I change the line to "After=NetworkManager-wait-online.service network-online.target" mediatomb is activated. (The NetworkManager-wait-online.service is still enabled)

Comment 5 Gwyn Ciesla 2013-08-29 14:45:06 UTC
Ok, cool, I'll get an update out.  Thanks!

Comment 6 Fedora Update System 2013-08-29 15:09:19 UTC
mediatomb-0.12.1-31.fc19.20120403gitb66dc1 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mediatomb-0.12.1-31.fc19.20120403gitb66dc1

Comment 7 Fedora Update System 2013-08-29 15:10:05 UTC
mediatomb-0.12.1-31.fc18.20120403gitb66dc1 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mediatomb-0.12.1-31.fc18.20120403gitb66dc1

Comment 8 Fedora Update System 2013-08-29 22:20:34 UTC
Package mediatomb-0.12.1-31.fc19.20120403gitb66dc1:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mediatomb-0.12.1-31.fc19.20120403gitb66dc1'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-15493/mediatomb-0.12.1-31.fc19.20120403gitb66dc1
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-09-07 01:24:48 UTC
mediatomb-0.12.1-31.fc19.20120403gitb66dc1 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-09-07 01:28:44 UTC
mediatomb-0.12.1-31.fc18.20120403gitb66dc1 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.