[plug] Keep-alive remote gnome session

Lucas van Staden lvs at dedmeet.com
Mon Jun 22 15:17:25 WST 2009


Hi,

Just an update, for those who care...

I did some tests, and the ping direction most definitely makes the 
difference.

Rather than doing a ping from local to remote, it now does an ssh to 
remote (ssh keys used so no password required), and runs the ping from 
remote to local.

So using : ssh melanie at 172.16.1.6 ping 172.16.1.3 -c 3 at the change of 
each song.

Been using it like that all day, and the remote machine has not gone to 
sleep (yet).

The plugin is still rough (hard coded ip's), once I am happy that it 
works fine (a week or so), and I have the time, I will add a 
configuration screen to allow setup of the remote machine address and 
ssh login, and make it available on my site for others.



-Lucas


Phillip Bennett wrote:
> Yes, doing the ping from the laptop caused it to stay up (as far as I
> can tell!)  I can't simply do a wake on LAN because the laptop is
> wireless and it shuts down the wireless card when it sleeps.  Well, that
> and the fact that I've never even looked into WOL....  :P
>
> I think it matters in which direction the pings are going.  FROM your
> machine to the server probably won't work, but TO your machine FROM the
> server should.  I would say it's because responding to pings isn't
> classed as "doing something" while sending out pings would be.  And is
> you did this from inside an ssh session it should be fine.  I'd say if
> you got your script to ssh to the box when Amarok starts, and get it to
> start pinging something, then killing the ssh session when Amarok
> closes, would be an OK solution.
>
> I looked around this morning (it's still morning where I am!), but
> couldn't find anything that mentions how to stop powersave..  I say give
> the pinging a go and let us know if it works or not.
>
> Phil.
>
> Lucas van Staden wrote:
>> Hi,
>>
>> screen is magic, I never ssh without it.
>>
>> So, in your case, doing an active ping from the machine that has the
>> power save setup, caused the machine to stay up?
>>
>> Also - could you not send a WOL packet to the laptop from your main
>> machine?
>> That bit works for me using 'wakeonlan', so I can wake it up, not
>> prevent the sleep at the moment.
>>
>> It is a pity the ping did not work, (should it?)
>> as that would have solved my issue.
>> It is easy to just send a couple of pings to the remote machine on every
>> track change in amarok.
>>
>> AT the moment, my solution is to:
>>
>> Write a bit of code in a script on the remote machine that does the
>> inhibit and uninhibit parts of the powersave.
>> On my machine, when amarok starts, I do an ssh to remote machine and
>> call that script to inhibit.
>> Amarok plays, (no further requests), except for a STOP PLAY event (which
>> I can trap) which again does an ssh, but this time to uninhibit.
>> There is also the uninhibit call if amarok is closed.
>>
>> Seems a bit long winded, so I am still doing a bit of checking to see if
>> a simple 'prod' to the remote machine will not also work.
>> It is just a pity that work gets in the way of giving this my 100%.
>>
>>
>> -Lucas
>>
>>
>> Phillip Bennett wrote:
>>
>>> I had a similar problem this week.  I was trying to ssh from work to
>>> home, then from my main machine to my laptop.  The laptop was asleep
>>> before I got to work due to the power saving options (It takes a while
>>> to get here)...  So I started a screen session on the laptop and 
>>> started
>>> pinging the main server, and left for work.  When I got to work, I 
>>> could
>>> still log in to the laptop and it was all fine.  When I was done, I 
>>> just
>>> reconnected the screen and stopped the pings.
>>>
>>> Hth,
>>> Phil.
>>>
>>>
>>> Lucas van Staden wrote:
>>>
>>>> Hi,
>>>>
>>>> Music is stored on wife's machine, shared using a nfs share.
>>>> Her machine is configured to 'sleep' after and hour's inactivity (done
>>>> using the gnome settings for screensaver/power management.)
>>>>
>>>> The obvious issue is that when I am listening to music (using Amarok),
>>>> the share would go away.
>>>>
>>>> I manually send a wakeonlan packet to the machine to wake it back up,
>>>> but that has become tedious, so I created a small script for amarok
>>>> which runs on each song change.
>>>>
>>>> the hope was that I could just ping to the remote machine on each song
>>>> change to keep it awake. It does not work. Ping was done with -c 3 to
>>>> limit pings sent.
>>>>
>>>> The settings in question must only be looking at the gnome (xorg)
>>>> session activity, so the ping is not registering.
>>>>
>>>> Any ideas how I can keep it alive via the script.
>>>> I can do a remote ssh connection with a command to run (will setup
>>>> private key to make that passwordless), but I have no idea what to 
>>>> do to
>>>> make the remote session stay active from the shell.
>>>>
>>>>
>>>> -Lucas
>>>>
>>>> _______________________________________________
>>>> PLUG discussion list: plug at plug.org.au
>>>> http://www.plug.org.au/mailman/listinfo/plug
>>>> Committee e-mail: committee at plug.linux.org.au
>>>>
>>>>
>>>>
>>>>
>>> ******************************************************************************************************************** 
>>>
>>>
>>>
>>> This message may contain confidential information. If you are not the
>>> intended recipient please inform the
>>> sender that you have received the message in error before deleting it.
>>> Please do not disclose, copy or distribute information in this e-mail
>>> or take any action in reliance on its contents:
>>> to do so is strictly prohibited and may be unlawful.
>>>
>>> Thank you for your co-operation.
>>>
>>> NHSmail is the secure email and directory service available for all
>>> NHS staff in England and Scotland
>>> NHSmail is approved for exchanging patient data and other sensitive
>>> information with NHSmail and GSI recipients
>>> NHSmail provides an email address for your career in the NHS and can
>>> be accessed anywhere
>>> For more information and to find out how you can switch, visit
>>> www.connectingforhealth.nhs.uk/nhsmail
>>>
>>> ******************************************************************************************************************** 
>>>
>>>
>>>
>>> _______________________________________________
>>> PLUG discussion list: plug at plug.org.au
>>> http://www.plug.org.au/mailman/listinfo/plug
>>> Committee e-mail: committee at plug.linux.org.au
>>>
>>
>> _______________________________________________
>> PLUG discussion list: plug at plug.org.au
>> http://www.plug.org.au/mailman/listinfo/plug
>> Committee e-mail: committee at plug.linux.org.au
>>
>>
>>
>
>
> ******************************************************************************************************************** 
>
>
> This message may contain confidential information. If you are not the 
> intended recipient please inform the
> sender that you have received the message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail 
> or take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all 
> NHS staff in England and Scotland
> NHSmail is approved for exchanging patient data and other sensitive 
> information with NHSmail and GSI recipients
> NHSmail provides an email address for your career in the NHS and can 
> be accessed anywhere
> For more information and to find out how you can switch, visit 
> www.connectingforhealth.nhs.uk/nhsmail
>
> ******************************************************************************************************************** 
>
>
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au




More information about the plug mailing list