APMD-List:
Archives

  
Back

to

APMD

Home

      Index: [thread] [date] [subject] [author]
  From: Craig Markwardt <craigm@pcasun3.gsfc.nasa.gov>
  To  : Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>
<apmd-list@worldvisions.ca> Date: Tue, 29 Sep 1998 11:59:14 -0400 (EDT)

Re: external call-out (was Re: apm proposed changes)

Pavel Machek writes:
 > Hi!
 > 
 > Bost aproaches are identical, you can always have one dispatcher that
 > calls other dispatchers, and you can always put -a
 > '/etc/central-dispatcher action_a' -b '/etc/central-dispatcher
 > action_b' ...

The question is: will people get confused by the dispatcher concept?

The command line method has the benefit that no action is performed if
it's not requested.  The dispatcher is something they have to install
themselves.  Of course, my implementation of the call-out mechanism
checks for the existence first, and does nothing if the dispatcher
isn't there.

I can also see what Avery is saying about disk access during standby
mode.  Every time /etc/apmd_proxy (or whatever) is called, its access
time changes, then sync() is called, and the disk is activated.

Response: logging and call-outs can be enabled/disabled individually 
          in my implementation.

Response: the first call of apmd_proxy will cause a disk access, but then 
          it should stay cached.  [ Unless you are doing a lot of disk IO,
          in which case you probably don't care if another disk access
          occurs. ]

Response: A user could put their apmd_proxy in a ram disk.  Not a particularly
          appealing solution to me.

Response: Does sync() need to be called for standby mode?  If the
          CPU is just going into slow-down mode, is there any reason
          at all?  [ Counter response: my Sony laptop actually turns
          off the CPU in standby mode. ]
          
          For a suspend, it's less of a problem, since it's likely the
          disk will be activated anyway.

How about the following proposal.  Have three command line switches for
apmd:

  -s "suspend command" 
  -r "resume command"
  -D                     ( enable dispatcher )

The logic for call-outs could be like so, in order:

  * if -s or -r have been specified, then call it, and return.
  * if -D has been specified, and the dispatcher program exists,
    then call it and return.
  * otherwise do nothing.

Craig


Index: [thread] [date] [subject] [author]


Write to me! apenwarr@worldvisions.ca