[Pm-utils] Making cron run after resume?

Stefan Seyfried seife at suse.de
Fri May 16 17:05:04 PDT 2008

Hi Nigel,

Nigel Cunningham wrote:

> I like the simplicity argument, but I have to admit at the same time
> that I'd like to see pm-utils catch up to the hibernate script in terms
> of functionality. The hibernate script has support for:

Lots of those are out of scope for pm-utils, since they should / can be done
easier from the GUI frontend that calls pm-utils via HAL, i'll go through the
list and just mark them as "GUI".

> - unloading modules and refusing to suspend if they can't be unloaded

can be done, although a module that cannot be unloaded does not abort suspend.
Generally, a module that needs to be unloaded is considered broken and should
be fixed in the kernel.

With the start of pm-utils, we wanted to get out of the workaround business,
and into the bugfixing business (i was too long in the workaround business
with the old powersaved ;)

> - stopping, starting and restarting services

Can be done, just a hook that does stop / start the service. However, for most
services the same applies as with modules: they should be made suspend-aware.
There are exceptions though, but those packages can deliver the hook to
stop/start the service. Infrastructure for such hooks is already in pm-utils.

> - umounting and remounting partitions

The desktops mount the external devices nowadays - g-p-m, kpowersave or
whoever just should tell them to unmount them. This buys you also the ability
to do an interaction in the case the external USB stick cannot be unmounted
for some reason. This gets very ugly very quick if you want to do it from a
script running as root. => GUI

> - modifying the grub/lilo menu to help ensure we resume
>   for resuming (yes, shouldn't be needed now)

I'm doing that already

> - running vga tools

done already

> - X screensaver locking

GUI - g-p-m / kpowersave should just tell the desktop to lock the screen.

> - running arbitrary scripts at arbitrary points in the suspend/resume 
>   process (on[suspend|resume] nn command)

Use case?

> - setting the cpu frequency to full speed while hibernating

Already done (at least i do it)

> - setting the various tuxonice options via a generic
> 	'procsetting file_name value'
>   interface. (Yeah, it's not /proc anymore)

This should be done in the tuxonice module

> - disabling disk write caches

why? I'm not against it, i just dont know why it is a good idea ;-)

> - taking down and bringing back up network interfaces

GUI => g-p-m should just tell nm-applet to bring down the network (which in
turn will eventually tell Thunderbird to stopp fetching mails etc).

> - muting/pausing audio

Why that?

> - ejecting pcmcia cards

Why not fix the drivers?

> - refusing to suspend/hibernate if particular programs are running

The desktop should already have an inhibition mechanism where programs can
request that no suspend happens if they are running (Richard surely knows more
about that topic).

> - getting gaim to logout/restore status etc

GUI => see above about network

> I'm not an expert on how the script works (I didn't write it), but I
> know it uses scriptlets that register hooks to make this all happen
> without being (too?) ugly.

And all the ugly stuff is in the scriptlets then? ;-)

pm-utils is designed to work together with HAL and a desktop application
(g-p-m or kpowersave) which is sufficiently intelligent to only tell HAL to
suspend the system if the prerequisites are fulfilled:
- external drives are unmounted
- network is brought down, before that, network applications are notified and
given a chance to finish their work
- nobody raised a complaint about suspend (cd-burning program,...)
- screen is locked
- ...

Back then one reason against powersave was the separation of policy and
carrying out the actual tasks. Back then i did not really agree, but today i
do. Among other reasons because it is really hard to do interactive stuff ("i
could not unmount the drive, what do you want to do now?") with another approach.

So today, policy is done by the desktop applet, "mechanics" are done by
pm-utils, and i think we should not change that. It makes for a better user
experience in the long run.


Stefan Seyfried
R&D Team Mobile Devices            |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

More information about the Pm-utils mailing list