2012-02-22, 12:39
Hi there,
(I know it's not really "XBMC" issue but I thought I just try my luck within the experts here)
I have a NAS (Ubuntu 11.10/NFS4) which goes to sleep when not in use and I tend to send an WOL magic-packet to wak up te server as soon as the XBMC box starts. So I wrote this little init.d script (on the XBMC box), namely: sendwol, to send the WOL signal during the boot:
and then created all the necessary Sys-V rc?.d links:
But it's not working. The script: wake-on-lan, which is actually in: /usr/local/bin, works just fine by its own and if the ran this init script manually (e.g. /etc/init.d/sendwol start) it's works just fine as well but not during the system boot time. Does anyone know what am I missing? The WOL is one of the important parts in my setup, so any help to solve/debug this issue would be very much appreciated. Cheers!!
(I know it's not really "XBMC" issue but I thought I just try my luck within the experts here)
I have a NAS (Ubuntu 11.10/NFS4) which goes to sleep when not in use and I tend to send an WOL magic-packet to wak up te server as soon as the XBMC box starts. So I wrote this little init.d script (on the XBMC box), namely: sendwol, to send the WOL signal during the boot:
Code:
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: sendwol
# Required-Start: $remote_fs $local_fs
# Required-Stop: $remote_fs $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Send WOL to mserv
### END INIT INFO
#
. /lib/lsb/init-functions
do_start() {
wol=`which wake-on-lan`
if [ "$?" -eq 0 ]; then
$wol mserv
else
echo "wake-on-lan not installed"
fi
exit
}
do_stop() {
echo "Action not supported"
exit
}
case "$1" in
start )
do_start
;;
restart|reload|force-reload )
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop )
do_stop
;;
* )
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
exit 0
and then created all the necessary Sys-V rc?.d links:
Code:
# ls -l /etc/rc?.d/* | grep sendwol | awk '{OFS=" "; print $8,$9,$10}'
/etc/rc0.d/K20sendwol -> ../init.d/sendwol
/etc/rc1.d/K20sendwol -> ../init.d/sendwol
/etc/rc2.d/S20sendwol -> ../init.d/sendwol
/etc/rc3.d/S20sendwol -> ../init.d/sendwol
/etc/rc4.d/S20sendwol -> ../init.d/sendwol
/etc/rc5.d/S20sendwol -> ../init.d/sendwol
/etc/rc6.d/K20sendwol -> ../init.d/sendwol
But it's not working. The script: wake-on-lan, which is actually in: /usr/local/bin, works just fine by its own and if the ran this init script manually (e.g. /etc/init.d/sendwol start) it's works just fine as well but not during the system boot time. Does anyone know what am I missing? The WOL is one of the important parts in my setup, so any help to solve/debug this issue would be very much appreciated. Cheers!!