Hi Bill.
>> I'd very much like to know how to get apmd to automate this, as
>> I've never worked it out so far, so if you can offer any clues,
>> they'll be very much appreciated...
> Do you mean you'd like to know how to get apmd to automatically
> do something on suspend and something else on resume?
That's exactly what I was referring to, and I've been rather
overwhelmed by the number of replies - well over 100 so far...
What I've done is the following patch...
--- etc/rc.d/init.d/apmd~ Thu May 27 00:57:47 1999
+++ etc/rc.d/init.d/apmd Thu May 27 00:59:57 1999
@@ -16,7 +16,9 @@
start)
echo -n "Starting up APM daemon: "
test -r "$CONFIG" && . "$CONFIG"
- daemon /usr/sbin/apmd "$APMD_OPTIONS"
+ daemon /usr/sbin/apmd "$APMD_OPTIONS" \
+ -r 'run-parts /etc/apmd/resume.d' \
+ -s 'run-parts /etc/apmd/suspend.d'
touch /var/lock/subsys/apmd
echo
;;
...and in addition, ran the following commands...
Q> cd /etc
Q> mkdir -p apmd/{resume,suspend}.d
Q> cat > apmd/suspend.d/pcmcia <<.EOF
Q> #!/bin/bash
Q> cardctl eject
Q> .EOF
Q> chmod 700 pcmcia
Q> rc.d/init.d/apmd restart
...and, after I'd done that, things work as required.
> If so, you want to see if your copy of apmd supports the "-s"
> and "-r" options. Recent versions, including the one shipped
> with RedHat 6.0, support these, though they're not mentioned in
> the man page. The argument to "-s" is a command to be run
> before suspending, and the argument to "-r" is a command to run
> before resuming.
Many thanks, that was the missing piece in this jigsaw...
> If you knew all that and were really asking what to put in the
> "something" and the "something else" that get run, well, beats
> me. In mine, I have the PCMCIA package's "cardctl eject" and
> "cardctl insert", respectively.
I have to admit that I knew what to put in it, I just didn't know how
to put it there.
Also, the said laptop doesn't always have the same IP address as it
gets plugged into several different networks that can't connect to
each other, so I don't have it automagically reconnecting on resume.
Best wishes from Riley.
+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html