Wake On Lan (WOL) -- Help! [Solved]
Re: Wake On Lan (WOL) -- Help!
I only use SysVinit, it still works on my computer. But let it be known that I am still on MX 21.3.
It is easier to fight for one's principles then to live up to them.
Re: Wake On Lan (WOL) -- Help!
Another blast from the pasttowwire wrote: Sun Dec 15, 2024 7:30 pm I only use SysVinit, it still works on my computer. But let it be known that I am still on MX 21.3.

I will test on my (SysVinit) system, and let you know if it works...
Finished setting-up cronjob in Job Scheduler, and rebooting now...
Re: Wake On Lan (WOL) -- Help!
@Senpai @towwire
Failed test using:

pre-test data:
post-test (reboot) data:
Will try now using "sbin", instead...
Failed test using:

pre-test data:
Code: Select all
opera-dude@GA-H270-HD3:~
$ date
Mon Dec 16 09:55:34 AM IST 2024
opera-dude@GA-H270-HD3:~
$ sudo ethtool eth0 | grep Wake-on
Supports Wake-on: pumbg
Wake-on: d
Code: Select all
opera-dude@GA-H270-HD3:~
$ date
Mon Dec 16 10:12:48 AM IST 2024
opera-dude@GA-H270-HD3:~
$ sudo ethtool eth0 | grep Wake-on
Supports Wake-on: pumbg
Wake-on: d
Re: Wake On Lan (WOL) -- Help!
Failure (using Job Scheduler):
$ sudo ethtool eth0 | grep Wake-on
[sudo] password for opera-dude:
Supports Wake-on: pumbg
Wake-on: d
However, manually, when I do this in CLI, I get:
Not sure why my setup in the Job Scheduler is not working 
And, BTW, "ethtool" is no longer in "/usr/bin", but in "/sbin/", as @Senpai noted:
So, just not sure how to correctly set-up Job Scheduler. Did as suggested, but not working:

I am starting Job Scheduler as root...
OK, see my error in the CLI:
I used "/usr/bin", when I should have used "/usr/sbin", as @towwire suggested.
Trying again...
Maybe that's the problem ?
$ sudo ethtool eth0 | grep Wake-on
[sudo] password for opera-dude:
Supports Wake-on: pumbg
Wake-on: d
However, manually, when I do this in CLI, I get:
Code: Select all
$ date
Mon Dec 16 10:30:08 AM IST 2024
$ sudo /sbin/ethtool -s eth0 wol g
$ sudo ethtool eth0 | grep Wake-on
Supports Wake-on: pumbg
Wake-on: g

And, BTW, "ethtool" is no longer in "/usr/bin", but in "/sbin/", as @Senpai noted:
Code: Select all
$ /usr/bin/ethtool -s eth0 wol g
bash: /usr/bin/ethtool: No such file or directory

I am starting Job Scheduler as root...
OK, see my error in the CLI:
I used "/usr/bin", when I should have used "/usr/sbin", as @towwire suggested.
Trying again...
Maybe that's the problem ?
Re: Wake On Lan (WOL) -- Help!
@Senpai and @towwire
So, this DOES work:

The problem was that even using "@reboot", it wasn't actually scheduling it until Midnight!

Also, here is what I get when looking for where crontab ("cron") lives:
I did a manual check, and it also lives in:
So, looks like we have a winner, either way!

So, this DOES work:

The problem was that even using "@reboot", it wasn't actually scheduling it until Midnight!

Also, here is what I get when looking for where crontab ("cron") lives:
Code: Select all
$ which cron
/sbin/cron
opera-dude@GA-H270-HD3:~
$ su
Password:
root@GA-H270-HD3:/home/opera-dude# which cron
/sbin/cron
Code: Select all
/usr/sbin/
- DukeComposed
- Posts: 1393
- Joined: Thu Mar 16, 2023 1:57 pm
Re: Wake On Lan (WOL) -- Help!
That's odd. "@reboot" in a crontab is intended to be run when the system starts. As in "After I reboot the machine, cron should run this line as soon as it comes back up again". Maybe it should have been called "@startup", but nonetheless it doesn't have a scheduled time and date when it runs. This is all just assuming standard Vixie cron, of course. I don't know what other cron replacements do.operadude wrote: Mon Dec 16, 2024 4:24 am The problem was that even using "@reboot", it wasn't actually scheduling it until Midnight!
Re: Wake On Lan (WOL) -- Help!
Thanks for the feedback!DukeComposed wrote: Mon Dec 16, 2024 4:54 amThat's odd. "@reboot" in a crontab is intended to be run when the system starts. As in "After I reboot the machine, cron should run this line as soon as it comes back up again". Maybe it should have been called "@startup", but nonetheless it doesn't have a scheduled time and date when it runs. This is all just assuming standard Vixie cron, of course. I don't know what other cron replacements do.operadude wrote: Mon Dec 16, 2024 4:24 am The problem was that even using "@reboot", it wasn't actually scheduling it until Midnight!
Yeah, something weird is going on:
I just rebooted, since I see that I deleted the default instructions for crontab, so I copied them from my KDE install and put them back on the Xfce (where I was modifying crontab via Job Scheduler).
On Xfce, where my cronjob lives:
Code: Select all
opera-dude@GA-H270-HD3:~
$ sudo crontab -l
[sudo] password for opera-dude:
# # Edit this file to introduce tasks to be run by cron.
# #
# # Each task to run has to be defined through a single line
# # indicating with different fields when the task will be run
# # and what command to run for the task
# #
# # To define the time you can provide concrete values for
# # minute (m), hour (h), day of month (dom), month (mon),
# # and day of week (dow) or use '*' in these fields (for 'any').
# #
# # Notice that tasks will be started based on the cron's system
# # daemon's notion of time and timezones.
# #
# # Output of the crontab jobs (including errors) is sent through
# # email to the user the crontab file belongs to (unless redirected).
# #
# # For example, you can run a backup of all your user accounts
# # at 5 a.m every week with:
# # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# #
# # For more information see the manual pages of crontab(5) and cron(8)
# #
# # m h dom mon dow command
@reboot /usr/sbin/ethtool -s eth0 wol g
Code: Select all
$ sudo ethtool eth0 | grep Wake-on
Supports Wake-on: pumbg
Wake-on: d
So, not sure

At this point, I'll just stick with "sudo etherwake <MAC Address>", which just works OOTB

- DukeComposed
- Posts: 1393
- Joined: Thu Mar 16, 2023 1:57 pm
Re: Wake On Lan (WOL) -- Help!
I'd check the logs to see if the command is running at startup as expected. One of the problems with trying to schedule something to always happen at startup is making sure the thing you want to do doesn't get run before the device/file/mountpoint you want to edit is up and initialized.operadude wrote: Mon Dec 16, 2024 5:02 am Yeah, something weird is going on:
"Wake-on: " should be followed by a "g"; NOT a "d".
So, not sure :confused:
At this point, I'll just stick with "sudo etherwake <MAC Address>", which just works OOTB :happy:
I'd honestly check if I couldn't put my network interface configs in /etc/network/interfaces or /etc/network/if-pre-up.d or if-up.d instead.
Re: Wake On Lan (WOL) -- Help!
@DukeComposed
Thanks!
Will check it out.
Thanks!
Will check it out.
Re: Wake On Lan (WOL) -- Help!
For your info the times listed for the @reboot mean nothing as reboot is not a timed event.DukeComposed wrote: Mon Dec 16, 2024 4:54 amThat's odd. "@reboot" in a crontab is intended to be run when the system starts. As in "After I reboot the machine, cron should run this line as soon as it comes back up again". Maybe it should have been called "@startup", but nonetheless it doesn't have a scheduled time and date when it runs. This is all just assuming standard Vixie cron, of course. I don't know what other cron replacements do.operadude wrote: Mon Dec 16, 2024 4:24 am The problem was that even using "@reboot", it wasn't actually scheduling it until Midnight!
Also remember this is on the machine to wake-up or start-up.
For example, if we wanted to have the system date written in a file called date.txt when Linux restarts, we would add the following string:
@reboot date >> ~/date.txt
Some url's that may help you understand.
Code: Select all
https://phoenixnap.com/kb/crontab-reboot
https://www.cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot/
Hope this help's.
It is easier to fight for one's principles then to live up to them.