WakeOnLan functions not working for me

Holger Macht hmacht at suse.de
Sat Apr 19 08:52:06 PDT 2008


On Sa 19. Apr - 14:33:38, Sam Morris wrote:
> I was playing around with the WakeOnLan functions but they don't seem to
> work for me. First I wanted to find out if WoL was supported on my
> system:
> 
>         $ dbus-send --system --dest=org.freedesktop.Hal --print-reply /org/freedesktop/Hal/devices/net_00_13_77_60_aa_1d org.freedesktop.Hal.Device.WakeOnLan.GetSupported
>         method return sender=:1.2 -> dest=:1.492 reply_serial=2
>            int32 1
> 
> That's odd, shouldn't it have returned a boolean?

Danny is right, int32 is correct here. That's just a design limitation of
all scripts called by HAL.

> I added some tracing info to the hal-system-wol-linux script and
> observed the following:
> 
>         + SUPPORT_FLAGS=
>         + IFACE=eth0
>         + which ethtool
>         + '[' 1 '!=' 0 ']'
>         + echo org.freedesktop.Hal.Device.WakeOnLan.NoEthtool
>         + exit 1
> 
> So it seems the exception is not being returned to the caller.

Right. It seems that you need to echo two strings. One for the exception,
and one for a description. The attached patch fixes this. It is simple,
I'll commit this.

> After I installed ethtool, calling GetSupported returned '0' instead of
> 'true', despite:
> 
>         + SUPPORT_FLAGS=
>         + IFACE=eth0
>         + which ethtool
>         + '[' 0 '!=' 0 ']'
>         + case "`basename $0`" in
>         ++ basename /usr/lib/hal/scripts/linux/hal-system-wol-supported-linux
>         + wol_supported
>         + wol_get_flags
>         ++ ethtool eth0
>         ++ awk '/Supports Wake-on:/{if ($3 ~ /g/) print $3 }'
>         + SUPPORT_FLAGS=pg
>         + '[' -n pg ']'
>         + return 0
>         + '[' -n pg ']'
>         + return 0
>         + exit 0
> 
> And GetEnabled returned 1 instead of false, despite:
> 
>         + SUPPORT_FLAGS=
>         + IFACE=eth0
>         + which ethtool
>         + '[' 0 '!=' 0 ']'
>         + case "`basename $0`" in
>         ++ basename /usr/lib/hal/scripts/linux/hal-system-wol-enabled-linux
>         + wol_enabled
>         ++ ethtool eth0
>         ++ awk '/[^s ]Wake-on:/{if ($2 ~ /g/) print $2 }'
>         + ENABLED=
>         + '[' -n '' ']'
>         + return 1
>         + exit 1
> 
> I'm using hal 0.5.11~rc2.

It's just a design decision about what to return. Scripts usually return 0
for success and 1 for failure. And due to the fact that those scripts
return int32, 0 is meant for success here.

Thanks,
	Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-wol-return-error.patch
Type: text/x-patch
Size: 875 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20080419/6491161b/attachment.bin 


More information about the hal mailing list