You are not logged in.

#1 2011-02-02 04:25:03

Cobaltounet
Member
Registered: 2010-11-10
Posts: 9

WOL, init scripts and KDE

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 g

And 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>&1

With 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>&1

In 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

#2 2011-02-02 19:18:23

wudu
Member
Registered: 2010-03-08
Posts: 83

Re: WOL, init scripts and KDE

hi,

try to do it in /etc/rc.local.shutdown

Offline

#3 2011-02-05 22:51:23

Cobaltounet
Member
Registered: 2010-11-10
Posts: 9

Re: WOL, init scripts and KDE

wudu wrote:

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.log

and the result is

Supports Wake-on: pumbg
Wake-on: g

In 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

#4 2011-02-08 09:03:36

wudu
Member
Registered: 2010-03-08
Posts: 83

Re: WOL, init scripts and KDE

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

#5 2011-02-08 09:14:55

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,229
Website

Re: WOL, init scripts and KDE

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

#6 2011-02-15 04:50:52

Cobaltounet
Member
Registered: 2010-11-10
Posts: 9

Re: WOL, init scripts and KDE

wudu wrote:

If so, try to disable it and configure your network manually.

Thanks, I will try do that.

Offline

#7 2011-02-15 05:09:59

Cobaltounet
Member
Registered: 2010-11-10
Posts: 9

Re: WOL, init scripts and KDE

zenlord wrote:

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

#8 2011-03-18 02:01:08

sigmund
Member
From: Milano, Italy, EU
Registered: 2009-12-06
Posts: 50

Re: WOL, init scripts and KDE

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

Board footer

Powered by FluxBB