WOL with autofs

#1

If I set up a video source using the Kodi-level NFS client mechanism, and if I activate the option Settings -> System -> Power saving -> Try to wakeup remote servers on access, then this seems to work as expected - if I browse into the source folder while the server is in sleep mode, the Vero 4K+ sends a WOL packet and wakes it up.

However, if the source is mounted at OS level using autofs, it doesn’t send a WOL packet (possibly because Kodi thinks the folder is in local storage, and it’s only at the OS level that it knows it’s a mounted remote NFS export).

Is it possible to get the Vero 4K+ to send a WOL packet under those circumstances?

0 Likes

Problems with server going into sleep mode
#2

Have a look at this: http://tech-bodges.blogspot.com/2010/06/linux-autofs-and-wake-on-lan-bodge.html

I think that will do what you are looking for. I haven’t tested it since I don’t use WOL.

That would be correct, Kodi thinks they are local files.

0 Likes

#3

@angry.sardine (or should I call you Bagpuss :wink: ) I got curious about this, so I setup one of my laptops to test WOL. If you can give me a few days, I think I can come up with a nice easy to setup solution for this. The idea I’m working on is to use a Python script instead of the shell script I linked, and will not require installing anything via apt. I’ve got the script so it can do the WOL, I just need to get it working with autofs now.

0 Likes

#4

Yes, please. :slight_smile:

0 Likes

#5

Gave you 9. :slight_smile: Did you make any progress on this?

0 Likes

#6

Sorry, I was thinking of giving you an update. I had almost gave up on the idea as it seemed that the --timeout option didn’t work. After several days, I finally figured that one out.

So I have a basic WOL autofs script working, it just needs fine tuning now.

1 Like

#7

@angry.sardine I have a basic python script working now that does the WOL (if needed), waits for the mount (smb or nfs) to become available and then does the mount. It’s a bit finicky right now. To help me understand it it will work for you, could you get me your auto.master and auto.maps so I can understand how you are using autofs and if the script will work for you? If you don’t want to share them here, please PM them to me.

0 Likes

#8

/etc/auto.master :

#
+dir:/etc/auto.master.d                                  
#                                                        
# Include central master map if it can be found using    
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes 
# precedence.                                            
#
+auto.master
 /- /etc/auto.nfs.shares --timeout 15 browse

/etc/auto.nfs.shares :

/mnt/nicolas-pc/Interim 192.168.1.13:/Interim
/mnt/nicolas-pc/VideoE 192.168.1.13:/VideoE              
/mnt/nicolas-pc/VideoF 192.168.1.13:/VideoF
/mnt/nicolas-pc/QBTE 192.168.1.13:/QBTE                  
/mnt/nicolas-pc/QBTF 192.168.1.13:/QBTF

I’m afraid I don’t know where to find auto.maps :frowning_face:

0 Likes

#9

That’s what I needed. One more question, are there files in the directories, or is everything in a subdirectory.

i.e. are there any files in /Interim, or is everything in directories under that like /Interim/x?

0 Likes

#10

Note that my previous post initially went a bit wonky - I’ve edited it, and I think it’s correct now. (Formatted text needed some kicking when input from a mobile web browser).

There are likely to be both files and subfolders in all of those shares, I’m afraid. :slight_smile:

0 Likes

#11

Unfortunately, what I’ve been able to get working will not allow files in the parent directory, only in sub directories. It seems to be a limitation of autofs that I haven’t been able to work around yet.

With that I have working, you would be able to access anything in a directory under /Interim, but not able to access files in /Interim.

That’s one of the reasons why it’s taken me some time to get back to you as I’ve been struggling with a way to mimic the /- way in autofs. For some reason when using a script with autofs the /- syntax that allows access to files in the parent directory does not work.

I will keep trying. I will have a script for you to test in the next few days (REALLY THIS TIME!!!) with that limitation.

0 Likes

#12

:rofl:

Okay, thanks. :sunglasses:

0 Likes

#13

:face_with_raised_eyebrow:

0 Likes

#15

‘Is there anybody there?’ said the Traveller,
Knocking on the moonlit door;
And his horse in the silence champed the grasses
Of the forest’s ferny floor:
And a bird flew up out of the turret,
Above the Traveller’s head
And he smote upon the door again a second time;
‘Is there anybody there?’ he said.

0 Likes

#17

I’m not that clued up on autofs, but this should do the trick: https://translate.google.com/translate?hl=en&sl=de&u=http://mike-gareiss.blogspot.com/2014/08/wake-on-lan-mit-autofs.html&prev=search

0 Likes

#18

I hadn’t given up on the idea, but while I can send a WOL packet via an autofs script, it is not at all reliable. I’ve been testing my script for weeks and just can’t get reliable WOL working. Maybe 50% of the time I can get it to work.

So as of now, I’ve decided that the script just isn’t currently feasible. The only way I can see to do it would maybe build in a WOL feature in autofs, but that’s mostly written in C and my C is very rusty.

0 Likes