You are not logged in.
Hello
So, I may be confused with how init scripts are working, but in this case there is something I do not get.
I am trying to be an energy efficient geek, so I decided to set-up a Wake On Lan (WOL) on my home server. The WOL itself is working fine, no issue on this side, but in order to have this working after each reboot, and according to the wiki, I have to add the following code to my rc.local file to set the WOL flag to my network interface.
ethtool -s eth0 wol gAnd here is the problem : by default, my "server" starts a kde session after the boot. So my inititab is like that :
## Only one of the following two lines can be uncommented!
# Boot to console
# id:3:initdefault:
# Boot to X11
id:5:initdefault:
.....
# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1With these settings, the WOL flag is not set correctly after the boot. Now, if I do not start kde, use a console login and change my inittab to :
## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:
.....
# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1In this case, the command in rc.local is executed correctly and my WOL flag is set as I want. So, either kde overwrites the flag when it starts or the rc.local file is not executed.
Anyone with a clue of what is going on and how to solve that ?
Thanks !
Last edited by Cobaltounet (2011-02-02 04:25:24)
Offline
hi,
try to do it in /etc/rc.local.shutdown
Offline
hi,
try to do it in /etc/rc.local.shutdown
Thanks wudu ! This is working with /etc/rc.local.shutdown. But this is not a perfect solution. If for whatever reason, the server crashes, I will not be able to restart it remotely.
I have looked into it further and added in rc.local a
ethtool eth0 | grep Wake-on >> /var/log/wol-boot.logand the result is
Supports Wake-on: pumbg
Wake-on: gIn other words, rc.local is doing his job correctly. It is most probably KDE that is resetting the flag. But after that, knowing what in kde exactly.... :-(
Offline
Glad that it works, but you're right, in case of crashing there's a problem.
I don't know much about KDE because I use GNOME.
Is there a network-manager which could cause the problem?
If so, try to disable it and configure your network manually.
Offline
Since your problem is solved, it might be the right time to ask my question to you regarding WOL:
My server broadcasts it's IP across the network to be discoverable as a uPNP-server. I'm guessing that functionality will be lost if it is turned off, so I should configure all my uPNP-clients to send a magical packet whenever I decide to use them (which would be nearly impossible: I don't see this possibility for a PS3...)
Offline
If so, try to disable it and configure your network manually.
Thanks, I will try do that.
Offline
Since your problem is solved, it might be the right time to ask my question to you regarding WOL:
My server broadcasts it's IP across the network to be discoverable as a uPNP-server. I'm guessing that functionality will be lost if it is turned off, so I should configure all my uPNP-clients to send a magical packet whenever I decide to use them (which would be nearly impossible: I don't see this possibility for a PS3...)
I am not an expert in uPNP, but I am afraid that there is not a lot of solutions to your problem. If your server is powered off, then something has to wake him up. You can probably do that from your laptop/desktop or your router directly but I do not think a PS3 can do it. And having to send the magic packet manually each time you want to use a uPNP device kind of defeat the convenience of the uPNP.
Offline
I would create a daemon under /etc/rc.d/ and add it to rc.conf.
This way, you might be able to run ethtool whenever you want, when starting up, as well as when shutting down either in both cases.
Last edited by sigmund (2011-03-18 02:01:36)
Definitely moving to GNU/Linux made me trust Computer Science once again.
Definitely moving to Arch made me enjoy and understand GNU/Linux once again.
Offline