И так после обновления WOL перестал работать. Нужно TrueNAS сказать, что надо бы это дело исправить.
WOL видно в свойствах сетевой карты. Это буквенное обозначение g
Устанавливается простой командой:
sudo ethtool -s <NIC> wol g
Но Linux (а теперь он, а не BSD в версии TrueNAS SCALE) не сохраняет все эти изменения.
Поэтому мы напишем скрипт, который будет запускаться при загрузке системы и вносить данное изменение в настройки сетевой карты. Все просто. Поехали!
PS оригинальное описание команд на английском языке после #
# Enabling WoL in the NIC
# Determining whether the NIC supports WoL
# First, determine which NIC will be used, and then check whether it supports the Magic Packet™ using
sudo ethtool <NIC>
# where <NIC> is the device name of your NIC, e.g. eth0.
# This command will output some information about your the capabilities of your NIC
# Имя своей сетевой карты можно посмотреть в настройках TrueNAS раздел Network
# If this output contains a line similar to the following:
Supports Wake-on: <letters>
# where <letters> contains the letter g, the NIC should support the WoL Magic Packet™ method
# (for the other letters look at man ethtool).
# Enabling WoL in the NIC
# To check whether WoL is enabled in the NIC, one could use
# and look for
Wake-on: <letters>
# If <letters> contains «g» and not «d», then Magic Packet™ is enabled.
# However, if <letters> does contain d, WoL needs to be enabled by running the following command:
sudo ethtool -s <NIC> wol g
# Non-interactive creation of script which will set the «Wake-on»
# option to «g» which means «Wake on MagicPacket». For the next step (systemd) to work correctly,
# you must have the she-bang line included on the first line of the file.
cat >> /root/wol_fix.sh <<EOF #!/bin/bash ethtool -s enp3s0 wol g EOF
# Set correct permissions for the fix script.
chmod 755 /root/wol_fix.sh
# Non-interactive creation of script which will run on boot to run the fixing script.
cat >> /etc/systemd/system/wol_fix.service <<EOF [Unit] Description=Fix WakeOnLAN being reset to disabled on shutdown [Service] ExecStart=/root/wol_fix.sh Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target EOF
# Reload the systemd manager configuration.
systemctl daemon-reload
# start the wol_fix.service
systemctl start wol_fix
# Check if it has enabled wake on g
sudo ethtool <NIC>
# It should now write
Wake-on: g
# Enable to wol_fix service script.
systemctl enable wol_fix.service
# NOTE: must reboot for the on-boot script to take effect.
# Or you can run the /root/wol_fix.sh script manually this time only before your next shutdown or reboot.
—-
# On next reboot make sure the scripts worked
# Etc.
ethtool <NIC>
# And look for g in Wake-On:
Wake-on: g
Работает!
проверено лично