Wol is working from S3, so I guess that the hardware/BIOS side is already set. The machine is a Samsung N210 netbook I wanted to test as a Squeezebox music server with a 1TByte external hard disk (might be replaced with an internal one) that should shut down automatically after a while when not used. I could do with S3 too, but the system boots so fast with systemd that a clean shutdown seems a better solution to me, thus avoiding potential S3 problems on kernel upgrades and other S3 oddities.
Sorry I break the thread, but I have the same netbook, and suspend is not working for me (arch linux), samsung-tools installed. Did you perform any hack? Are you using pm-utils?
Thanks and best regards
]]>@menta
The Wiki has an example script to put in '/etc/systemd/system' which enables wol for me from S3.
https://wiki.archlinux.org/index.php/Wol#With_systemd
I tried your approach and my system still does not wol from shutdown btw.
Thanks, I didn't emphasized, but I use that example /etc/systemd/system/wol@.service file AND the described /usr/lib/systemd/system-sleep/wol.sh script simultaneously. With the wol@.service file alone I was able to wake on my system when it wasn't suspended/hibernated, just simply poered off. Introduction of the wol.sh script helped to be able to wake up the system when suspend/hibernate occured before shutdown.
]]>#!/bin/sh
# Setting WOL to Active
/usr/sbin/ethtool -s eth0 wol g
Don't forget to make it executable!
Since man 8 systemd-sleep considers this kind of solutions as hack, I also tried the following alternative code in /etc/systemd/system/wol@.service, however it didn't work:
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target
After=sleep.target
Before=halt.target
Before=poweroff.target
Before=kexec.target
Before=shutdown.target
[Service]
ExecStart=/usr/sbin/ethtool -s %i wol g
Type=oneshot
[Install]
WantedBy=multi-user.target
WantedBy=sleep.target
WantedBy=halt.target
WantedBy=poweroff.target
WantedBy=kexec.target
WantedBy=shutdown.target
Any suggestions how to make this work without the /usr/lib/systemd/system-sleep/wol.sh script?
]]>One thing though: are you using a wired or wireless internet connection? If wireless, it's possible that your wireless adaptor/card remains on and keeps a connection to your router while in suspend, but isn't receiving power when your PC is shutdown.
]]>