Power Management for Camarabuntu

2 views
Skip to first unread message

Steven

unread,
Oct 7, 2009, 6:06:20 AM10/7/09
to Camara
Hi all,

I'm currently looking into the possibility of presetting automatic
power options on all our computers. I.e. auto power off after a
computer has been left idle and logged out for a certain length of
time.

Is there already the software in place in Camarabuntu to do this?

If not, I was wondering does anyone know of any little programs for
Linux that are out there which would suit this purpose. Or even
better, someone who would be able to write a small program for us!

Thanks,
Steven

envir...@camara.ie

Rory McCann

unread,
Oct 7, 2009, 10:41:19 AM10/7/09
to dal...@gmail.com, Camara, Ubuntu NGO

(CC'ing the Ubuntu NGO group, since they might know more)

This is technology in Linux to do this. After all, laptops do this all
the time. However that's designed for laptops, so it has the concept of
things like "I'm running on battery now", something that desktops don't
have.

Mostly the software would have been written for us rich westerners in
mind and so would always stay on if it's plugged in. It might be
possible to change the gnome-power-manager thingie to turn a desktop
computer off if it hasn't been used in a while.


Rory McCann

signature.asc

Steven

unread,
Oct 7, 2009, 12:08:39 PM10/7/09
to Camara
Thanks Rory, that's great.

How difficult would it be to change the gnome power manager to carry
out those functions?

Anyone that has any insight / more technical knowledge than my (very
limited!) amount, please reply to the thread :)

Steven.

On Oct 7, 3:41 pm, Rory McCann <r...@technomancy.org> wrote:
> On 07/10/09 11:06, Steven wrote:
>
>
>
> > Hi all,
>
> > I'm currently looking into the possibility of presetting automatic
> > power options on all our computers. I.e. auto power off after a
> > computer has been left idle and logged out for a certain length of
> > time.
>
> > Is there already the software in place in Camarabuntu to do this?
>
> > If not, I was wondering does anyone know of any little programs for
> > Linux that are out there which would suit this purpose. Or even
> > better, someone who would be able to write a small program for us!
>
> > Thanks,
> > Steven
>
> > environm...@camara.ie
>
> (CC'ing the Ubuntu NGO group, since they might know more)
>
> This is technology in Linux to do this. After all, laptops do this all
> the time. However that's designed for laptops, so it has the concept of
> things like "I'm running on battery now", something that desktops don't
> have.
>
> Mostly the software would have been written for us rich westerners in
> mind and so would always stay on if it's plugged in. It might be
> possible to change the gnome-power-manager thingie to turn a desktop
> computer off if it hasn't been used in a while.
>
> Rory McCann
>
>  signature.asc
> < 1KViewDownload

Alex Bacik

unread,
Oct 7, 2009, 9:46:28 AM10/7/09
to Camara
Steven,

Sounds like a simple cron job to check that no-one's logged in, and
the last logout was longer than a set threshold. I don't mind writing
it, here's one that will shut down on a specified idle time, even if
someone's logged in.

http://ubuntuforums.org/archive/index.php/t-530973.html

A

Alex Bacik

unread,
Oct 7, 2009, 2:37:11 PM10/7/09
to dal...@gmail.com, Camara
On Oct 7, 3:41 pm, Rory McCann <r...@technomancy.org> wrote:
> This is technology in Linux to do this. After all, laptops do this all
> the time. However that's designed for laptops, so it has the concept of
> things like "I'm running on battery now", something that desktops don't
> have.

I don't think Ubuntu comes with anything that could be used for this
purpose; mostly it's just suspending / hibernating or adjusting the
power consumption to the cpu. I'm not 100% sure, but I think you'd
have to build a script, no?

Alex

Steven

unread,
Oct 8, 2009, 5:44:54 AM10/8/09
to Camara
Alex,

Thanks so much for your posts.

That would be brilliant if you could write a script that would shut
down a logged out computer that has been idle for 30 minutes.
Would that take you long? (Again, I have no idea about these
programming thingies!)

I'm going to talk to the guys in the workshop here and get moving on
pre loading it on all computers ASAP.

Steven

Alex Bacik

unread,
Oct 13, 2009, 10:41:34 AM10/13/09
to Steven Daly, Camara
Steven,

Here's the script. I've tested it on Camarabuntu 9.04. You can adjust
the threshold, I've set it to 20 minutes but you may want to make that
longer - perhaps an hour?

You'll need to copy it to /usr/local/bin/idleout.sh, chown it to
root:root and chmod it to 755.

idleout.txt

Steven

unread,
Oct 13, 2009, 11:43:19 AM10/13/09
to Camara
Alex,

Thank you very much for doing that, fantastic.

I will keep you updated on the progress of getting it on to the
computers and operating out in the schools.

Thanks again, I really appreciate your help,
Steven.
>  idleout.txt
> < 1KViewDownload
>
>
>
> You'll then need to run it from /etc/crontab every (say) 15 minutes:
>
> */15 * * * * root /usr/local/bin/idleout.sh >>  /var/log/idleout.log
>
> Every time it's triggered it'll log to /var/log/idleout.log
>
> Let me know if you need any help - you can contact me on +353 87  
> 2617333 if you need a hand.
>
> thanks,
>
> Alex
>
> On 13 Oct 2009, at 15:31, Steven Daly wrote:
>
> > Alex,
>
> > That's brilliant. Is is possible to send that by email or can you  
> > upload it somewhere?
>
> > I've been talking to the guys here and it looks good for getting  
> > this going ASAP.
>
> > Thanks again for your help on this,
> > Steven
>
> > 2009/10/12 Alex Bacik <a...@bacik.ie>
> > Steven,
>
> > Almost finished that script, looks like it'll be ready tomorrow.
>
> > Alex
Reply all
Reply to author
Forward
0 new messages