tag:blogger.com,1999:blog-5849371431507772066.post5720715244285943656..comments2013-01-31T18:01:19.137-08:00Comments on Odds and ends with a technical slant.: Linux autofs and Wake on Lan bodge.Techie Bloggerhttp://www.blogger.com/profile/14846589916857598132noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5849371431507772066.post-75753584713483079362013-01-31T18:01:19.137-08:002013-01-31T18:01:19.137-08:00Thanks for posting your bodging exploration. Using...Thanks for posting your bodging exploration. Using the above as a starting pointing, I created the following for my XBMC setup:<br /><br />#!/bin/bash <br /> ping -c 1 -w 1 -q xbmc > /dev/null <br /> if [ $? -ne 0 ] <br /> then <br /> /usr/sbin/etherwake xbmc <br /> for (( i=1; i <= 60; i++ )) <br /> do <br /> nc -zw 1 xbmc 2049 <br /> [ $? -ne 0 ] || sleep 1; break <br /> [ $i -ne 60 ] || exit 1 <br /> done <br /> fi <br /> echo -e "-fstype=nfs4,ro,soft\txbmc:/$1"<br /><br />See http://pastebin.com/gbFtRWcm for a formatted version ;)<br /><br />So, with "/mnt/xbmc /etc/auto.xbmc --timeout=30" in auto.master, the XBMC box will wake up and autofs will mount /mnt/xbmc/music or /mnt/xbmc/video or whatever, as soon as nfsd is ready to receive connections. rufflovehttps://www.blogger.com/profile/01096649615527099308noreply@blogger.comtag:blogger.com,1999:blog-5849371431507772066.post-41332760049323660322011-03-02T23:46:26.879-08:002011-03-02T23:46:26.879-08:00Hi, thanks very much for your post, exactly what I...Hi, thanks very much for your post, exactly what I needed to do myself.<br />However, it did not work like that for me from the start, and after some research I found that there seems to be an error in the output of your script; in my autofs version at least, the result of the executable map _must not_ contain the name of the directory that one tries to mount; i.e. instead of<br />video -fstype=nfs,ro,intr,soft media-server:/usr1/media-server/video<br />the script should produce<br />-fstype=nfs,ro,intr,soft media-server:/usr1/media-server/video<br />and the script needs to check the first argument ($1), because there autofs passes in the name of the directory to be mounted (video, in your case); and only for $1 being video, the script should produce any output.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5849371431507772066.post-2977890057106457472011-01-18T12:39:07.520-08:002011-01-18T12:39:07.520-08:00Hello,
thank you for this article! I searched long...Hello,<br />thank you for this article! I searched long the net for an answer how to combine wake on lan and autofs. The wake on lan is already working for my nasbox so i tried now to use your script but autofs will not work when I use that code. It executes the wakeup (and this works) but automount says it can't mount.<br />The same problem is when I add the execute flag to a default autofs file. So I think the script is not the problem but the execute flag.<br />I use Ubuntu 10.10 with autofs 5.05. What version did you use? Maybe you have an idea to this.<br /><br />Cheers,<br />DavidAnonymousnoreply@blogger.com