Forum

Full Version: XMBC doesn't start automatically with nfs shared configured
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Last week I decided to try Xbian (beta 2) on my RPi, every thing went perfectly until I configured my nfs share in /etc/fstab:
Code:
server:/media/share        /mnt/nas        nfs     udp,rw,noatime,nolock           0       0

After that configuration XBMC did not autostart anymore after reboot and loging prompt was shown.

I investigated it and the problem was that XBMC service was not started by upstart because conditions were not met.

xbmc.conf start conditions:
Code:
start on started xbmc-preload and started dbus and (started autofs or xbian-nowait)

And those conditions were not met because of "xbian-nowait" and "autofs" part.

I think that autofs is not installed by default in my system so it will never start.

And xbian-nowait event is only raised by "mountall" if no nfs shares are configured.
Code:
grep -v ^# /etc/fstab| awk '{print $3}' | sort | grep -q 'nfs\|nfs4' || initctl emit -n xbian-nowait || :

I was able to workarround the problem changing xbmc.conf start conditions to:
Code:
start on started xbmc-preload and started dbus

But I'm not sure why that condition was included and it may be a more elegant solution to just delay a little the XBMC start if a nfs share is configured.

I could not find any related topic so maybe I'm doing something wrong... Confused

Best regards
Same issue here. Thanks for analyzing!

I created xbmc.override with
Code:
start on started xbmc-preload and started dbus and mounted MOUNTPOINT=/home/xbian/.xbmc
because it won't work w/o the NFS mounts here anyway (this includes network as the library is on the MySQL server).

Boy, I thought systemd is weird, but it's sugar compared to upstart.
This problem has been discussed already in the Beta 2 thread.
(25th Jan, 2014 12:57 AM)CurlyMo Wrote: [ -> ]This problem has been discussed already in the Beta 2 thread.

As far as I know, similar issues has been discussed but I couldn't find this exact issue.

Because my share is not broken and automounts correctly at each reboot, i don't have problems with dhcp or interfaces, it is not an issue of NFS version, etc.

In my case it is more simple: if I configure a nfs share XBMC is not startted automatically and I end up in the shell.
@Lukeid

but this problem with libnfs updates is REALLY discussed few times in B2 thread and others as well.
I read the whole beta2 thread twice, and found some posts abaout xbmc service failing and dropping to shell if nfs fails to mount due to slow dhcp requests and such, but nothing about this specific issue: even if network starts fine and all nfs shares mount properly, the xbmc service will not start.

Lukeid's analysis looks perfectly reasonable to me, autofs isn't installed by default in the stable repo, and xbian-nowait is only emited if no nfs mounts are found in fstab. But the xbmc upstart service depends on one of those. Changing the dependencies fixes it for me, too. So thanks again for debugging @Lukeid.

Maybe I just failed to read between the lines correctly in the B2 thread, or I just have tomatoes on my eyes. Sorry if that's the case, but could you maybe link to a post where this was discussed then?
@teekay I totally agree with you.
Before posting I spent a couple of days searching the forum and reading the beta 2 thread, and I didn’t find any solution. (Maybe I'm not good enough searching forums Confused)

So when I found a working solution I decided to post it here in order to help other people.

But I still think that it is more like a workaround than a final fix. Maybe the fix would be to include autofs by default or just introduce some seconds of delay before raising the xbian-nowait event.

Trying to find a final fix was the other reason of my post. Smile

Best regards, and thank you all for your support.
@Lukeid

this should have happened already.

worked ?
(3rd Feb, 2014 12:13 PM)mk01 Wrote: [ -> ]@Lukeid

this should have happened already.

worked ?

Do you mean changing xbmc.conf?
From:
Code:
start on started xbmc-preload and started dbus and (started autofs or xbian-nowait)
To:
Code:
start on started xbmc-preload and started dbus

Yes, that works most of the time. But maybe a better solution could be delay a bit the starting of XBMC if a NFS share is found. Or include autofs by default.
autofs is there by default meanwhile, after a dist-upgrade about 2 weeks ago.

The automatic migration of /etc/fstab was a bit awkward, but in the end using autofs and the standard upstart xbmc.conf works reliably here and that's what matters.
So the problem is solved by a dist-upgrade and migrating to autofs here.
Yes, after latest updates autofs is installed. So as you said, migrating fstab mounts to autofs and restoring upstart original configuration everything works as expected.

Thank you everybody Smile
thanks for confirming
Reference URL's