Jump to content
XPEnology Community

Wake on Lan, how?


oakey

Recommended Posts

I've made some progress. I pulled all the HDD's and booted it up, then ran the DSM. It asked to install a HDD, did that (hot) and then it wanted me to install DSM. I didn't do that. I shut it down. I then started it back up with the HDD in and I actually managed to navigate DSM with no network dropout. Shut it down again and now adding each HDD back in one by one. 

Link to comment
Share on other sites

So where are we? It appears that you:

- identified that your network infrastructure was not the issue because WOL worked on other boxes, and works on the NAS if you do a forced shutdown (remove power vs. menu -> shut down)

- made sure that eth0_wol_options="g" in root/etc/synoinfo.conf

- made sure that support_wol="yes" in same file

- made sure WOL was ticked in DSM GUI

- added an rc.d startup/shutdown script named root/usr/local/etc/rc.d/S99ZZZ_Shutdown.sh with the contents from that post (this script appears to do two things: on startup, if the /var/packages/shutdown_script/DSShutdown.sh file exists, it runs it, hopefully you don't have this file; on shutdown it executes the command `ifconfig eth0 down`, which is the command to turn off your eth0 network adapter, which is typically your first or only ethernet port)

- made it executable via `sudo chmod 755 root/usr/local/etc/rc.d/S99ZZZ_Shutdown.sh` which makes it executable by owner, assuming you created it as root, it would be owned by root

 

My understanding is that the linux OS DSM is built on is designed to automatically execute scripts in the root/usr/local/etc/rc.d directory on startup passing 'start', and on shutdown passing 'stop', in alphanumeric order, hence that name, which should cause it to be executed last of the rc.d scripts.

 

And now you are at a weird place where the box doesn't come up clean some times and if it comes up your packages aren't running or aren't appearing correctly in the GUI?

 

Do you have a file called /var/packages/shutdown_script/DSShutdown.sh? If you do, it appears to be being called at startup if I understand the script. I don't know that you really want to do that. Searching for that file name, I found https://sourceforge.net/p/advpowermgr4ds/discussion/bugs/thread/095d53ea/#8356 indicating to me that it's possible someone reused the script from this post, didn't understand what it did, but since they didn't have /var/packages/shutdown_script/DSShutdown.sh it didn't have any adverse effect. That post has references to the files mentioned in the script which confuse me about why they are being referenced at all. The whole post seems to be about hijacking a Syno package called shutdown_script which may be a pre-requisite for that other post.

 

The right script as far as I can tell (UNTESTED BY ME) would be

#! /bin/sh

case $1 in
start)
    # No-op
    ;;
stop)
    ifconfig eth0 down
    exit 0
    ;;
*)
    echo "Usage: $0 [start|stop]"
    ;;
esac

This script assumes that /bin/sh is the right path to the shell interpreter, which it probably is. It doesn't exit with any code during startup, which is probably fine but may result in a log message. It exits successful (0) during shutdown after doing what you want, which is to turn off your eth0. The `*)` means, if run with any other than start or stop, do this, hence usage. 

 

So back to your problem, if you have a /var/packages/shutdown_script/DSShutdown.sh file it could be causing problems, and I don't understand the changing of eth0_wol_options="d" to "g" to know if that could cause problems. 

 

EDIT: as far as I can tell, the eth0_wol_options="g" in root/etc/synoinfo.conf attempts to tell the ethernet card to set Wake-On to "g" (rather than "d"). "d" is disabled, "g" is wake on magic packet. Its the same as doing it manually via the ethtool command, e.g., `ethtool -s eth0 wol g`. You could issue the command `ethtool eth0` to see the settings for the ethernet card. If everything is set properly you should see included in the output

 

Supports Wake-on: pumbg

Wake-on: g

 

the Supports line should include g (the other values don't matter, it needs to support wake on magic packet which means it needs to include a g). And the actual Wake-on setting needs to stay g.

 

Edited by aol
Link to comment
Share on other sites

Great informative post. 

 

Currently I'm at the stage where everything *appears* to be working with the exception of one HDD which has been showing as 'crashed' for a while now in DSM and couldn't be written to (only read). If I install this drive back in to the system I end up with the problem where I get a network connection briefly on startup and then it loses the connection and I have to pull the plug. I'm currently in the process of swapping that with a HDD that's in my WinPC (once the data transfer finishes). 

 

Right now though Xpenology / DSM seems to be working as it should. 

 

From what I can understand the issue with WoL not working seems to be with the way the system shuts down through DSM. If you killed it at the power switch and tried WoL it would wake it up but then if you shutdown from within DSM or DS Finder Wake on Lan wouldn't work again until the system was killed at the switch. When I added that weird S99ZZZ_Shutdown.sh then Wake on Lan worked even if you shutdown through the DSM, I don't really know why or how that script influences Wake on Lan. 

 

I'm currently looking in Putty and I don't appear to have shutdown_script dir or DSShutdown.sh

 

Thanks for the help, it's been really useful.

Edited by oakey
Link to comment
Share on other sites

So stupid question, but how do I add a new disk?

 

I've added HDD3 and DSM sees it. My existing drives are SHR but I don't see how to make the new drive the same. I thought you had to go to RAID group and create a new one and then you go to volume and create but RAID group doesn't give me the option to create an SHR disk.

Link to comment
Share on other sites

  • 3 years later...
On 6/1/2018 at 6:12 PM, aol said:

So where are we? It appears that you:

- identified that your network infrastructure was not the issue because WOL worked on other boxes, and works on the NAS if you do a forced shutdown (remove power vs. menu -> shut down)

- made sure that eth0_wol_options="g" in root/etc/synoinfo.conf

- made sure that support_wol="yes" in same file

- made sure WOL was ticked in DSM GUI

- added an rc.d startup/shutdown script named root/usr/local/etc/rc.d/S99ZZZ_Shutdown.sh with the contents from that post (this script appears to do two things: on startup, if the /var/packages/shutdown_script/DSShutdown.sh file exists, it runs it, hopefully you don't have this file; on shutdown it executes the command `ifconfig eth0 down`, which is the command to turn off your eth0 network adapter, which is typically your first or only ethernet port)

- made it executable via `sudo chmod 755 root/usr/local/etc/rc.d/S99ZZZ_Shutdown.sh` which makes it executable by owner, assuming you created it as root, it would be owned by root

 

My understanding is that the linux OS DSM is built on is designed to automatically execute scripts in the root/usr/local/etc/rc.d directory on startup passing 'start', and on shutdown passing 'stop', in alphanumeric order, hence that name, which should cause it to be executed last of the rc.d scripts.

 

And now you are at a weird place where the box doesn't come up clean some times and if it comes up your packages aren't running or aren't appearing correctly in the GUI?

 

Do you have a file called /var/packages/shutdown_script/DSShutdown.sh? If you do, it appears to be being called at startup if I understand the script. I don't know that you really want to do that. Searching for that file name, I found https://sourceforge.net/p/advpowermgr4ds/discussion/bugs/thread/095d53ea/#8356 indicating to me that it's possible someone reused the script from this post, didn't understand what it did, but since they didn't have /var/packages/shutdown_script/DSShutdown.sh it didn't have any adverse effect. That post has references to the files mentioned in the script which confuse me about why they are being referenced at all. The whole post seems to be about hijacking a Syno package called shutdown_script which may be a pre-requisite for that other post.

 

The right script as far as I can tell (UNTESTED BY ME) would be


#! /bin/sh

case $1 in
start)
    # No-op
    ;;
stop)
    ifconfig eth0 down
    exit 0
    ;;
*)
    echo "Usage: $0 [start|stop]"
    ;;
esac

This script assumes that /bin/sh is the right path to the shell interpreter, which it probably is. It doesn't exit with any code during startup, which is probably fine but may result in a log message. It exits successful (0) during shutdown after doing what you want, which is to turn off your eth0. The `*)` means, if run with any other than start or stop, do this, hence usage. 

 

So back to your problem, if you have a /var/packages/shutdown_script/DSShutdown.sh file it could be causing problems, and I don't understand the changing of eth0_wol_options="d" to "g" to know if that could cause problems. 

 

EDIT: as far as I can tell, the eth0_wol_options="g" in root/etc/synoinfo.conf attempts to tell the ethernet card to set Wake-On to "g" (rather than "d"). "d" is disabled, "g" is wake on magic packet. Its the same as doing it manually via the ethtool command, e.g., `ethtool -s eth0 wol g`. You could issue the command `ethtool eth0` to see the settings for the ethernet card. If everything is set properly you should see included in the output

 

Supports Wake-on: pumbg

Wake-on: g

 

the Supports line should include g (the other values don't matter, it needs to support wake on magic packet which means it needs to include a g). And the actual Wake-on setting needs to stay g.

 

any advice to make it working under DSM 7.0?

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...