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)
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.
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
ipaddress (or network name) of machine you want to wake up
default 0 which will perform ordinary icmp ping. else a 'connect' attempt will be done to the specified port
only applicable if pingport!=0, if 1 will not only connect to pingport but also wait until data is actually read back
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
time to wait for machine to wake up (advise is to set this to servers actual anticipated startup time)
time to perform extended wait for machine to wake up
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