ethtool and rc.d scripts
Posted: 26. Jul 2018, 21:53
Hello world, this is basically a question about startup/shutdown scripts, couched in wake on lan question
.
WOL works once, but after startup ethtool eth0 shows Wake-on: d (disabled.) If I use sudo ethtool -s eth0 wol g, it will again work once, but is then disabled. From my searching, the answer appears to be to place the above enabling command in a startup or shutdown script, so that it will be enabled each time, and ready for the next wakeup.
So, I tried putting ethtool -s eth0 wol g in rc.local_shutdown, thinking it better to have it run at shutdown rather than startup, so that even if it became disabled during a session, it would be re-enabled at shutdown. That didn't work, and I'm not sure why not.
Do I need to use sudo in the script? (I thought perhaps the startup/shutdown scripts would run with system privileges.)
Or, does it need to go in some other script (rc.local?) With or without sudo?
Thanks for any help.

WOL works once, but after startup ethtool eth0 shows Wake-on: d (disabled.) If I use sudo ethtool -s eth0 wol g, it will again work once, but is then disabled. From my searching, the answer appears to be to place the above enabling command in a startup or shutdown script, so that it will be enabled each time, and ready for the next wakeup.
So, I tried putting ethtool -s eth0 wol g in rc.local_shutdown, thinking it better to have it run at shutdown rather than startup, so that even if it became disabled during a session, it would be re-enabled at shutdown. That didn't work, and I'm not sure why not.
Do I need to use sudo in the script? (I thought perhaps the startup/shutdown scripts would run with system privileges.)
Or, does it need to go in some other script (rc.local?) With or without sudo?
Thanks for any help.