Udev boot rule seemingly not working - how to debug?

I"m trying to set up wake on LAN, but having problems making the wake on lan linux settings persistant.

The guide there says to make a udev rule: /etc/udev/rules.d/81-wol.rules with:

ACTION==“add”, SUBSYSTEM==“net”, NAME==“enp*”, RUN+="/usr/bin/ethtool -s $name wol g"

Now when I reboot I would expect

sudo ethtool enp34s0 | grep Wake-on

would show me that wake on lan is set to “g” but it is set to “d” which means disabled.
So it looks like the rule is not run at boot.

Now I need to always run ethtool with sudo so I am not sure if that is causing the failure. Is there a way I can see some sort of log of what might be happening?

First you could try udevadm test /sys/class/net/<interface name> to see if the rule triggers.

Thanks @pobrn

I have a pastebin here: https://pastebin.com/k4FHmjeq
the rule seems to run but looks to have failed without info that appears to help.

Yes, because it’s not run as root:

ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
ethtool: could not set ethtool features for enp34s0
enp34s0: Could not set offload features, ignoring: Operation not permitted

You could try running sudo udevadm test .... But in any case, the rule seems to be set up correctly.