Inactivity Shut-down on FC8

Mauriat mirandam at gmail.com
Wed Apr 22 19:50:51 UTC 2009


On Wed, Apr 22, 2009 at 9:06 AM, Bradley <pursley001 at comcast.net> wrote:
> I would like to hear some ideas on how to set the computer to shut-down due
> to inactivity.  The feature to sleep the computer for inactivity doesn't
> work properly as my computer doesn't support a "sleep" feature.  It can only
> hibernate or shut down.  Any thoughts?
>
> Bradley

If you think this is a limitation of your software, then try with
Fedora10 or something newer.

However the following is just an idea: I wrote a bash script to do
exactly this.  Basically the script works like this:
I have a set of applications.  Once every minute I check if those
applications are running by awking or grepping something out of ps or
top or whatever.  If none are running I increment a counter, and sleep
for a minute.  Once this counter reaches 15 (ie. 15min) I execute a
shutdown.  If any are running, then I reset the counter to 0, sleep
for a min, and repeat.  (If the cpu load is higher than a threshold or
if certain lockfiles exist, I also reset the counter)

I did this on a 5 yr old Redhat8 computer, so the basics apply to any
linux.  I launch the script as root out of rc.local.  I'm pretty sure
the hibernate can be called via a command using pm-utils in newer
versions of Fedora.

-Mauriat




More information about the fedora-list mailing list