[Pm-utils] Making cron run after resume?

Victor Lowther victor.lowther at gmail.com
Sat May 10 21:30:04 PDT 2008


On Sun, 2008-05-11 at 09:42 +1000, Nigel Cunningham wrote:
> On Sat, 2008-05-10 at 08:13 -0500, Victor Lowther wrote:
> > On Thu, 2008-05-08 at 18:16 -0500, Victor Lowther wrote:
> > > On Thu, 2008-05-08 at 16:17 +0200, Michael Biebl wrote:
> > > > 2008/5/8 Richard Hughes <hughsient at gmail.com>:
> > > > > In reference to
> > > > > this: https://bugzilla.redhat.com/show_bug.cgi?id=445603
> > > > >
> > > > > Should we be kicking cron a resume time to do the stuff we should have
> > > > > done whilst suspended?
> > > > 
> > > > See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469135
> > > > (a user request to run anacron on resume and AC plug).
> > > > 
> > > > Imho we should only kick anacron on resume if we are plugged on AC.
> > > > 
> > > > It would probably also make sense to kick anacron on AC plug events.
> > > 
> > > Seems like a good hook to put in the anacron package.
> > 
> > ...
> > 
> > How about the following hook-running convention:
> > 
> > When running hooks in normal sort order, hooks shall run in two phases:
> > 
> > Phase 1: All hooks that DO NOT begin with two leading digits shall run
> > first (in no guaranteed order), and the success or failure of these
> > hooks SHALL be ignored by the pm-utils framework.
> 
> That's confusing. I'd suggest that either hooks without two leading
> digits don't get run, or all hooks get run in C-local lexical sort
> order.

We run them in lexical sort order on suspend and reverse lexical sort
order on resume. In the context of this email conversation, the
'anacron' hook would run before the '99video' hook on resume, when the
'anacron' hook should run after all the more important hooks run.

If we switched the ordering to reverse lexical order on suspend and
lexical order on resume, then this proposal could vanish, but then I
suspect Stefan would be even more annoyed by that particular
non-backwards compatibile change.

> I'd also argue that result codes should be consistently treated. Ignore
> them all or don't ignore them at all. It's not hard to make a script
> return "I succeeded" if some failure shouldn't result in aborting. I'm
> not sure what the current behaviour is. Perhaps I could have just said
> "I agree with Stefan".

The current behavior is (effectivly) "ignore everything".  I would like
to make pm-utils a little smarter about how to handle things when (say)
needed video quirks don't get applied causing the system to hardlock on
resume.

> Nigel
> 
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list