 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

19th December 2011, 09:02 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Location: AZ
Posts: 3

|
|
|
FC16, systemd & mediatomb wait for (eth0) network..
Hi, I have configured systemd to start mediatomb, it works when I start from a shell, however on boot, mediatomb complains that eth0 is not available.
I have added After=NetworkManager.service to the mediatomb.service file, and "systemctl enable NetworkManager-wait-online.service" to tell systemd not to start any other services until the network is up. Still the same problem..
Code:
[Unit]
Description=MediaTomb Daemon
After=NetworkManager.service
[Service]
EnvironmentFile=/etc/mediatomb/systemd.conf
ExecStartPre=route add -net 239.0.0.0 netmask 255.0.0.0 $MT_INTERFACE >/dev/null 2>&1
ExecStart=/usr/bin/mediatomb -u $MT_USER -g $MT_GROUP -P $MT_PIDFILE -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR -p $MT_PORT -e $MT_INTERFACE
Restart=on-abort
[Install]
WantedBy=multi-user.target
Code:
[root@x264 ~]# systemctl status mediatomb.service
mediatomb.service - MediaTomb Daemon
Loaded: loaded (/lib/systemd/system/mediatomb.service; enabled)
Active: failed since Mon, 19 Dec 2011 01:48:47 -0700; 12h ago
Process: 823 ExecStart=/usr/bin/mediatomb -u $MT_USER -g $MT_GROUP -P $MT_PIDFILE -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR -p $MT_PORT -e $MT_INTERFACE (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/mediatomb.service
[root@x264 ~]# tail /var/log/messages
Dec 19 01:49:17 x264 dbus-daemon[793]: Mounting CIFS filesystems: [ OK ]
Dec 19 01:49:17 x264 dbus-daemon[793]: Mounting other filesystems: [ OK ]
Dec 19 01:49:17 x264 rpc.mountd[978]: Version 1.2.5 starting
Dec 19 01:49:17 x264 systemd[1]: Startup finished in 2s 341ms 167us (kernel) + 2s 195ms 113us (initrd) + 45s 626ms 169us (userspace) = 50s 162ms 449us.
[root@x264 ~]# tail /var/log/mediatomb
2011-12-19 01:48:47 INFO: Setting playlist charset to UTF-8
2011-12-19 01:48:47 WARNING: You enabled the YouTube feature, which allows you
to watch YouTube videos on your UPnP device!
Please check http://www.youtube.com/t/terms
By using this feature you may be violating YouTube
service terms and conditions!
2011-12-19 01:48:47 INFO: Configuration check succeeded.
2011-12-19 01:48:47 ERROR: Could not determine interface address: Cannot assign requested address
2011-12-19 01:48:47 ERROR: Could not find interface: eth0
Any ideas?
|

20th December 2011, 09:34 AM
|
 |
Retired Administrator
|
|
Join Date: Oct 2006
Posts: 21,509

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
Try setting the correct network adapter in /etc/mediatomb.conf , eth0 isn't correct for f16, run ifconfig to find the correct name.
|

20th December 2011, 04:07 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Location: AZ
Posts: 3

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
Quote:
Originally Posted by leigh123linux
Try setting the correct network adapter in /etc/mediatomb.conf , eth0 isn't correct for f16, run ifconfig to find the correct name.
|
Yes it is, eth0 is correct, as I said before it works ok when run from a root shell.
The problem is that systemd is trying to start the mediatomb service before NetworkManager has successfully setup eth0, despite being told otherwise.
I guess i'll file a bug.
|

20th December 2011, 04:16 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,612

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
IF the issue is that medaitomb is trying to start before networkmanager has the network completely up and settled, then try forcing systemd to wait for it before starting other services.
Code:
systemctl enable NetworkManager-wait-online.service
|

20th December 2011, 06:24 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Location: AZ
Posts: 3

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
Quote:
Originally Posted by DBelton
IF the issue is that medaitomb is trying to start before networkmanager has the network completely up and settled, then try forcing systemd to wait for it before starting other services.
Code:
systemctl enable NetworkManager-wait-online.service
|
Didn't you read the post?...
---------- Post added at 11:24 AM ---------- Previous post was at 10:10 AM ----------
Quote:
Originally Posted by DBelton
I guess you can't read my post either,
This is a known issue between network manager telling systemd that the network is ready and systemd starts firing up services that need the network.
I told you how to force systemd to wait until the network is ctually up and settled, but I guess you couldn't read that.
|
Yes i did read your post that's how I came to respond, and I asked if you have read mine, because you have suggested that I try something that has already been done and was described in the original post.
Also its not hard to see that the problem here is the fact that I did try that and it didn't work, hence the reason for the post in the first place..
again thanks for taking the time to respond...
|

25th February 2012, 06:17 PM
|
|
Registered User
|
|
Join Date: Feb 2012
Location: Ufa, Russia
Posts: 1

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
The only solution I've found is to sleep for a while to wait for network interface is up and after that sleep again to wait for DHCP.
Here is my solution:
1. sudo vim /etc/rc.d/init.d/mediatomb
2. comment line "[ ${NETWORKING} = "no" ] && exit 0"
3. append lines just after "start)":
numberOfRetries=5
while [ $numberOfRetries -ge 1 -a ${NETWORKING} = "no" ]
do
numberOfRetries=$(( $numberOfRetries - 1 ))
sleep 3
. /etc/sysconfig/network
done
sleep 5
|

25th February 2012, 07:30 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,102

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
As seen elsewhere, sleeping is not reliable. You don't know how long it will take for network manager to get the network initialized. It can take many minutes when then dhcp client doesn't get a quick reply.
And enabling NetworkManager-wait-online.service won't work if the service that needs to be delayed doesn't wait for it...
Your "After" line need to have 'network.target' and not "NetworkManager.service".
Last edited by jpollard; 25th February 2012 at 07:33 PM.
|

26th May 2012, 01:37 PM
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 8

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
Try this.
Add the following line in crontab.
Code:
@reboot sleep 20;service mediatomb start
"@reboot" means this is performed at every boot. "sleep 20" means it waits for 20 seconds after boots.
I have had the same issue on Ubuntu, but have resolved it by this workaround.
|

26th May 2012, 02:40 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,102

|
|
|
Re: FC16, systemd & mediatomb wait for (eth0) network..
So now we have to resort to using cron to start things...
You do realize that cron is also started before the network..... right?
So sleeping doesn't really help as you STILL don't know how long to wait...
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 08:36 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|