[ltp] how does apm operate?

Marius Gedminas linux-thinkpad@linux-thinkpad.org
Tue, 13 Apr 2004 16:49:21 +0300


--oFbHfjnMgUMsrGjO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 13, 2004 at 06:57:39AM -0500, Ivarsson, Torbjorn (T) wrote:
> In my continuous efforts to solve my
> KDE-keeps-crashing-when-resuming-problem I am trying to figure out
> exactly how apm/apmd works so that I can insert my own debugging code.
> I was under the impression that there are some scripts somewhere that
> apm use when suspending/resuming, but I can't find them.

On my Debian system they are in /etc/apm.  Everything starts with
/etc/apm/apmd_proxy which calls other scripts in /etc/apm/*.d/

I also had problems with crash-a-few-seconds-AFTER-resume.  I finally
figured out it was due to hwclock --hctosys call in one of the resume
scripts.  I do not know the reason, but accessing the hardware clock
(even when you just try to see the time on the screen) crashes my T23
after a single suspend/resume cycle.  I commented out all calls to
hwclock in my APM scripts and now very rarely have crashes on resume.

I also added a script called /etc/apm/suspend.d/99sync with the
following contents:

  #!/bin/sh
  if [ "$1" =3D "suspend" ]; then
    sync
  fi

It flushes the disk cache just before suspend and thus reduces the
chances of data corruption somewhat.  Before I added that script, my
/etc/modules.conf used to get corrupted on each crash and the system
wouldn't boot (that's why I ditched reiserfs and went back to ext3).

> I have downloaded the source for apm/apmd (v3.something) and briefly
> looked through the code. There's only one reference to a script-file,
> apmd_proxy. The file came with the source tarball but I cannot find it
> in my system (MDK10).

man apmd:

  FILES

         /etc/apmd_proxy
                Proxy program that is run if none is specified.

         /etc/apm/apmd_proxy
                Proxy program that is run if none is specified. (Debian)

> Questions: Can anyone briefly explain the chain of events when apm
> suspends and resumes the computer? What files are used etc.? Or is
> there a good resource anywhere that I can dig through?

Marius Gedminas
--=20
Many people enjoy Perl, many enjoy Python, some enjoy /bin/tcsh.  The latter
population should however, needless to say, be put into working camps.
		-- viktor on Slashdot

--oFbHfjnMgUMsrGjO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAe+/hkVdEXeem148RAg/QAKCJnAPAPJFTtQfFldNRPEAqXJgkGwCfQwK0
0hxbLWNh9NhFh5NXsqFh3KU=
=tE/G
-----END PGP SIGNATURE-----

--oFbHfjnMgUMsrGjO--