Bug 44603

Summary: please provide a pre-suspend hook
Product: [Retired] Red Hat Linux Reporter: Enrico Scholz <rh-bugzilla>
Component: apmdAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 3.0.2-16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-19 20:50:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2001-06-14 17:52:03 UTC
Description of Problem:

On my laptop I am running am-utils and have set

| NETFS_RESTART="yes"

in /etc/sysconfig/apmd.

Everytime I am suspending the machine, /etc/sysconfig/apm-scripts/apmscript
tries to unmount all NFS volumes by calling `/etc/rc.d/init.d/netfs stop'.

Because am-utils managed directories are appearing as NFS volumes, the
netfs script will try to unmount them also. This does not work and the
`umount -a -t nfs' hangs until it times out.

The proper way would be to stop `amd' before.


This can be cured by handling the am-utils case in the `apmscript'
explicitly or by providing a hook for scripts being executed before all
other actions.

Latter solution could be (the `+'-line):

------ /etc/sysconfig/apm-scripts/apmscript ----
case "$PROG" in
    suspend|standby)
+        [ -f /etc/sysconfig/apm-scripts/apmcontinue-pre ] && .
/etc/sysconfig/apm-scripts/apmcontinue-pre "$PROG"
        # Remove sound progs and modules if requested
        if [ "$RESTORESOUND" = "yes" -o "$RESTORESOUNDPROGS" = "yes" ]; 
-------------------------------------------------

Then the user can place in /etc/sysconfig/apm-scripts/apmcontinue-pre
needed actions like `service amd stop'.

Comment 1 Bernhard Rosenkraenzer 2001-06-26 16:28:21 UTC
Done in 3.0final-33, thanks for the suggestion


Comment 2 Bernhard Rosenkraenzer 2001-06-26 16:29:08 UTC
*** Bug 45706 has been marked as a duplicate of this bug. ***

Comment 3 Enrico Scholz 2001-11-16 17:52:19 UTC
pre-hook support disappeared in apmd-3.0final-34 and -35. Is this intentionally
or just a mistake?

Comment 4 Bernhard Rosenkraenzer 2002-02-26 16:55:21 UTC
Mistake. Re-added in 3.0.2-6.

Comment 5 Aleksey Nogin 2002-11-22 06:15:27 UTC
For some reason /etc/sysconfig/apm-scripts/apmcontinue-pre is now called w/o any
arguments which makes it somewhat useless. It should be called with $@ as arguments.

Thanks!

Comment 6 Bill Nottingham 2003-05-19 20:50:01 UTC
That was fixed in 3.0.2-16.