Automatic WakeOnLan upon accessing MySql or FileShares
#1
Hi all!

I have sent in a patch today (Ticket #12739) that adds a feature to XBMC :
XBMC will automatically issue a 'wake-on-lan' packet to MySql or FileShare Server right before it needs to contact them (if so configured).

There are different ways of doing this (plugins or os-specific scripts) but non of them have quite solved my needs, therefore this patch.
Hoping it will get accepted for a future build!
Edit : The patch has been merged and should become available from XBMC 13 (Gotham) Alpha 4 (May 2013)

**

Description (updated)

Feature is enabled under "system/settings/system/power saving/try to wake remote servers on access"

When feature gets enabled or shares gets added an autoscan will be done for any servers specified, either in shares or in MySQL settings.
The autoscan will if necessary create a file called 'wakeonlan.xml' and will add entries for these servers including macaddress which should be picked up in the scan.

Sample 'wakeonlan.xml'
Code:
<onaccesswakeup>
    <netinittimeout>60</netinittimeout>
    <netsettletime>500</netsettletime>
    <wakeup>
        <host>10.0.0.6</host>
        <mac>11:11:F2:11:DF:1E</mac>
        <pingport>3306</pingport>
        <pingmode>1</pingmode>
        <timeout>600</timeout>
        <waitonline>38</waitonline>
        <waitonline2>40</waitonline2>
        <waitservices>0</waitservices>
    </wakeup>
</onaccesswakeup>

netinittimeout [secs]
time xbmc will wait for network to (re)connect when booting or after resuming from suspend-mode
netsettletime [milli secs]
time to wait for network to be consistently connected before progressing
host
ipaddress (or network name) of machine you want to wake up
mac
macaddress
pingport
default 0 which will perform ordinary icmp ping. else a 'connect' attempt will be done to the specified port
pingmode
only applicable if pingport!=0, if 1 will not only connect to pingport but also wait until data is actually read back
timeout [secs]
specifies how long time (default 600) of inactivity must pass before a new 'wake-on-lan' check is performed. a good choice is to use same value as server's idle-timeout before entering sleep-mode
waitonline [secs]
time to wait for machine to wake up (advise is to set this to servers actual anticipated startup time)
waitonline2 [secs]
time to perform extended wait for machine to wake up
waitservices [secs]
additional time to wait after ping response, to allow server daemons to startup

useful pingport/pingmode combinations ;
pingport = 445 / pingmode = 0 - port 445 is used by samba (windows file sharing) and can be used for 'ping-probing' (but only pingmode = 0)
pingport = 3306 / pingmode = 1 - port 3306 is default MySQL port and useful if your server is the MySQL host
port 21 (ftp), 22 (ssl), 23 (telnet) are also likely to work OK if your server has that service installed

when using pingport = 0 (normal icmp ping) it is recommended to use waitservices = (ca) 5 to allow services on server to startup after server responds to ping. if using a different pingport it is normally not nessesary to add additional wait time
Reply


Messages In This Thread
Automatic WakeOnLan upon accessing MySql or FileShares - by t4_ravenbird - 2012-03-01, 15:11
[No subject] - by vexation - 2012-03-01, 17:10
[No subject] - by t4_ravenbird - 2012-03-01, 20:45
[No subject] - by Vascular - 2012-03-02, 15:29
[No subject] - by t4_ravenbird - 2012-03-02, 15:42
[No subject] - by regnets - 2012-03-08, 20:05
[No subject] - by Dam0 - 2012-03-09, 13:41
Logout Mark Read Team Forum Stats Members Help
Automatic WakeOnLan upon accessing MySql or FileShares4