You are not logged in.

#1 2011-07-26 22:33:32

themusicalduck
Member
Registered: 2011-07-04
Posts: 123

Setting up wakeonlan - using rc.local to run ethtool does not work

I have a laptop connected to a desktop. I want to start the desktop using a crossover ethernet cable. If I run the command "sudo ethtool -s eth1 wol g" in a terminal then power off on the desktop, the laptop is able to start the desktop with "wol -p 7 -h IP mac". I'd like to have the ethtool command run on startup, so I added ethtool -s eth1 wol g to the end of /etc/rc.local. For some reason after powering off the desktop, the wakeup packet won't work. It will only work if I run the command in the terminal, power off and then send the packet.

This is the full contents of /etc/rc.local -

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

ethtool -s eth1 wol g

Last edited by themusicalduck (2011-07-27 14:13:07)

Offline

#2 2011-07-26 22:46:46

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Setting up wakeonlan - using rc.local to run ethtool does not work

Perhaps a time-delay is required to enable setup..........


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2011-07-26 23:06:50

themusicalduck
Member
Registered: 2011-07-04
Posts: 123

Re: Setting up wakeonlan - using rc.local to run ethtool does not work

A time delay in rc.local? I added "sleep 10" before ethtool but it hasn't helped.

Offline

#4 2011-07-27 13:14:38

themusicalduck
Member
Registered: 2011-07-04
Posts: 123

Re: Setting up wakeonlan - using rc.local to run ethtool does not work

I put in "echo test" on the end of the file to see if it was running at all, and it does seem to be running. There was also no output that I could see from ethtool, so I can only assume that it is being run properly and is giving no error.

I can't understand why that command doesn't work when a command done in the terminal after login does work.

Offline

#5 2011-07-27 13:49:20

themusicalduck
Member
Registered: 2011-07-04
Posts: 123

Re: Setting up wakeonlan - using rc.local to run ethtool does not work

I have no idea why, but since I added the echo onto the end of the file, it has started to work. For now anyway.

EDIT: Spoke too soon. Sometimes it works, sometimes it just doesn't work at all.

Last edited by themusicalduck (2011-07-27 14:13:32)

Offline

Board footer

Powered by FluxBB