[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: a new suspend daemon

OK I'm looking  at writing a daemon that will  take care of suspending
my machine after  a period of inactivity. Initially  this will be just
for my use  but maybe eventually extendable to  the rest of userworld,
hence this message.
If you're running debian on your desktop, and you don't like excessive
noise, power  consumption, etc.; have your  machine automatically spin
down  the  disks and  enter  APM suspend  mode  after  some period  of
inactivity. By  "period of inactivity" I  mean no one  has touched the
mouse or keyboard for a while, and the CPU has been idle for a while.
Why a new daemon:
1. You'd think apmd would do this, but I can't get apmd to do this.
(If I'm the only one who  can't get apmd to do this, maybe I should
rethink the daemon idea.)
2. The script I run now works as a cron job. This is not so great
        a) it's hard for noflushd to spin down my disk if
        cron runs a script every five minutes
        b) it generates lots of log entries
        c) probably other reasons, plus it's not very elegant
3. There is this thing called  acpi which will probably come with lots
of neat  utilities like this,  but if I'm  not mistaken this  will not
happen for a while. My daemon will use APM not ACPI.

Before I get too excited I'd like to request some feedback. 
1) Would anyone other than me have use for such a thing
2) What sort of features would you like to see
3) Which    features    are    already    provided    by    existing
4) Would you be willing to test the code on your own machine
5) What is the correct way to write a (GNU-compliant?) UNIX daemon? 
I've never written one. I'm guessing a simple fork() somewhere and for
the  rest I  only  need to  read some  files  in /proc  and call  some
programs like hdparm and apm. But there are many daemons that do things
like this so perhaps there is a standardized way of doing it, in which
case I would like to know about this standard. 
6) Would you be willing to help me debianize the daemon? 


Reply to: