Fedora Linux Support Community & Resources Center
  #1  
Old 19th December 2011, 09:02 PM
rockstar08 Offline
Registered User
 
Join Date: Dec 2011
Location: AZ
Posts: 3
windows_7chrome
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?
Reply With Quote
  #2  
Old 20th December 2011, 09:34 AM
leigh123linux
Guest
 
Posts: n/a
linuxfirefox
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.
Reply With Quote
  #3  
Old 20th December 2011, 04:07 PM
rockstar08 Offline
Registered User
 
Join Date: Dec 2011
Location: AZ
Posts: 3
windows_7chrome
Re: FC16, systemd & mediatomb wait for (eth0) network..

Quote:
Originally Posted by leigh123linux View Post
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.
Reply With Quote
  #4  
Old 20th December 2011, 04:16 PM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,330
linuxfirefox
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
Reply With Quote
  #5  
Old 20th December 2011, 06:24 PM
rockstar08 Offline
Registered User
 
Join Date: Dec 2011
Location: AZ
Posts: 3
windows_7chrome
Re: FC16, systemd & mediatomb wait for (eth0) network..

Quote:
Originally Posted by DBelton View Post
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 View Post
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...
Reply With Quote
  #6  
Old 25th February 2012, 06:17 PM
6opuc Offline
Registered User
 
Join Date: Feb 2012
Location: Ufa, Russia
Posts: 1
linuxfirefox
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
Reply With Quote
  #7  
Old 25th February 2012, 07:30 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,870
linuxfirefox
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.
Reply With Quote
  #8  
Old 26th May 2012, 01:37 PM
dieselpower Offline
Registered User
 
Join Date: Jul 2011
Posts: 8
linuxubuntuchrome
Re: FC16, systemd & mediatomb wait for (eth0) network..

Try this.
Code:
sudo crontab -e
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.
Reply With Quote
  #9  
Old 26th May 2012, 02:40 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,870
linuxfirefox
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...
Reply With Quote
Reply

Tags
eth0, fc16, mediatomb, network, systemd, wait

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS and FC16 and systemd lensman3 Servers & Networking 4 15th March 2012 01:58 AM
Network problems after upgrade to FC16 josefk Using Fedora 2 15th December 2011 02:28 PM
F15: Cannot start mediatomb (systemd) trojanfoe Using Fedora 4 17th October 2011 06:00 PM
F10 network install from CD - We have to wait! sor Installation, Upgrades and Live Media 2 8th December 2008 11:25 AM
"Bringing up interface eth0" and wait... jopa Servers & Networking 2 25th October 2004 10:08 PM


Current GMT-time: 13:38 (Friday, 31-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Basildon Travel Photos on Instagram - Taquara Photos - Mahmutlar