Bug 20892 - apmscript hangs on 'pidof X'
apmscript hangs on 'pidof X'
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
7.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Dale Lovelace
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-14 19:41 EST by Felix Lee
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-17 13:04:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Felix Lee 2000-11-14 19:41:51 EST
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 11:35:18 EST
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 11:47:58 EST
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 13:04:26 EST
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 12:39:14 EST
Fixed in 3.0.2-6

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