Thanks for the idea to add a debug log to /usr/lib/systemd/systemd-wakeonlan
The problem was the .service at the end of systemctl stop wakeonlan.service as shown in the guide I linked.
running
works.
For future reference, to enable wake on lan on boot for an ethernet device in centos.
Get your enthernet device name with $ nmcli and replace enp9s0 with your device.
/usr/lib/systemd/systemd-wakeonlan
Code: Select all
#!/bin/sh
# only usable for root
[ $EUID = 0 ] || exit 4
start() {
ethtool -s enp9s0 wol g
}
stop() {
ethtool -s enp9s0 wol d
}
case "$1" in
start|stop) "$1" ;;
esac
/usr/lib/systemd/system/wakeonlan.service
Code: Select all
[Unit]
Description=Configure Wake-up on LAN
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-wakeonlan start
ExecStop=/usr/lib/systemd/systemd-wakeonlan stop
[Install]
WantedBy=basic.target
The final step was to enable the service on boot
Code: Select all
# systemctl enable wakeonlan.service
ln -s '/usr/lib/systemd/system/wakeonlan.service'\
'/etc/systemd/system/basic.target.wants/wakeonlan.service'
I will mark as Solved after I have rebooted the system