Bug 20892 - apmscript hangs on 'pidof X'
Summary: apmscript hangs on 'pidof X'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apmd
Version: 7.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Dale Lovelace
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-15 00:41 UTC by Felix Lee
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-11-17 18:04:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Felix Lee 2000-11-15 00:41:51 UTC
when I suspend my laptop, it never finishes suspending.

in /etc/sysconfig/apm-scripts/apmscript, 'pidof X' is run after network
cards are suspended.

for some reason, 'pidof X' wants to stat every /proc/###/exe file, and if
any running program lives on an NFS partition, then pidof will hang on the
stat, so the suspend doesn't finish until I restart the network card.

I tried moving the 'pidof X' code earlier in apmscript, but this still
hung, because for some reason my network card gets suspended before
apmscript gets run.  I'm not sure why that's happening.

my workaround was to add this to /etc/sysconfig/apmd:
  # disable pidof, to prevent 'pidof X' from hanging
  pidof () { false; }

I think the best place to fix this is in pidof.  pidof should be changed so
it won't hang on NFS.

Comment 1 Bill Nottingham 2000-11-15 16:35:18 UTC
Actually, I'd say that the network should be shut down *after* it tries to find
out if X is running.

Comment 2 Felix Lee 2000-11-15 16:47:58 UTC
ok, yes.  that should probably be done too.  though I still haven't figured out
why 'cardctl suspend' happens before apmscript gets run.

but my rationale is that pidof is used in many system scripts, not just here,
and it really should work whether or not NFS is working.


Comment 3 dkaplan 2000-11-17 18:04:26 UTC
Hi,

I have also had this problem when going into and coming out of standby.  In the
messages log I got the following error 

	Nov 14 10:38:56 volcan logger: FAIL: Wrong parameter "standby" in apmscript!

My solution was to downgrade the version of apmd, but it would be nice to fix
this.  

I also have found that sometimes when I halt the machine never actually turns
off.  Everything ends, so it isnt really a problem, but it is a bit annoying. 
Could this be related?

David


Comment 4 Bernhard Rosenkraenzer 2002-02-26 17:39:14 UTC
Fixed in 3.0.2-6


Note You need to log in before you can comment on or make changes to this bug.