Set Wake-On-LAN in my BIOS and TrueNAS was stubbornly refusing to Wake when I sent a magic packet to it's MAC address.
After booting this is the output of ethtool showing Wake-On-LAN is disabled (Wake-on: d)

The following two scripts are installed to run as the system shutsdown
# cat /etc/systemd/system/wol_fix.service
[Unit]
Description=Fix WakeOnLAN being reset to disabled
[Service]
ExecStart=/bin/true
ExecStop=/root/wol_fix.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
This logs an entry you can view with journalctl -t wol_fix or to the output of the unit use journalctl -u wol_fix
# cat /root/wol_fix.sh
#!/bin/bash
echo "Running wol_fix script to set WOL to enabled" | systemd-cat -t wol_fix
ethtool -s enp5s0 wol g
Remember to enable the service
systemctl daemon-reload
systemctl enable wol_fix.service
systemctl start wol_fix.service
Send a WOL packet to the TrueNAS box (do this from a computer or a
wakeonlan d8:5e:d3:da:f1:14

0 Comments