Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Configuring the APM Daemon

© Copyright Darrell Anderson.

Although Slackware supports the APM daemon, like so many options users have to manually tweak the configuration files. Additionally, this nominal support provides no rc.d script similar to the rc.acpid script. This seems odd, but easily remedied.

Minimally, supporting the APM daemon requires enabling a kernel module. Open /etc/rc.d/rc.modules and find the section that looks like this:

### APM support ###
# APM is a BIOS specification for saving power using several different
# techniques. This is mostly useful for battery powered laptops.
#/sbin/modprobe apm

Remove the hash mark from that last line:

### APM support ###
# APM is a BIOS specification for saving power using several different
# techniques. This is mostly useful for battery powered laptops.
/sbin/modprobe apm

Save rc.modules. This at least gets the APM daemon running at boot-up. Yet, suppose for some reason users want to stop the service but not shutdown the box? Unlike the rc.acpid script that accepts start/stop/restart parameters, there is no rc.apmd script to do likewise. The solution is to open a command line, find the apmd process, and then use the kill command to terminate that process. Additionally, what if users later want to restore the service? That would require opening a command line and typing modprobe apm. Good enough for some people, but an rc.d script would be more consistent.

To provide this consistency, create an rc.apmd script (select the link below for an example that should work for everybody), and then modify the rc.M script.

In the rc.M script, find the section that starts either the apm or acpi daemons:

# Start APM or ACPI daemon.
# If APM is enabled in the kernel, start apmd:
if [ -e proc/apm ]; then
  if [ -x /usr/sbin/apmd ]; then
    echo "Starting APM daemon: /usr/sbin/apmd"
    /usr/sbin/apmd
  fi
elif [ -x /etc/rc.d/rc.acpid ]; then # otherwise, start acpid:
  /etc/rc.d/rc.acpid start
fi

Modify the lines affecting the apmd:

# Start APM or ACPI daemon.
# If APM is enabled in the kernel, start apmd:
if [ -e /proc/apm ]; then
   if [ -x /etc/rc.d/rc.apmd ] ; then
      /etc/rc.d/rc.apmd start
   fi
elif [ -x /etc/rc.d/rc.acpid ]; then # otherwise, start acpid:
      /etc/rc.d/rc.acpid start
fi

If you are using an rc.shutdown script, then modify that script to shutdown the apm daemon:

# Shut down the apm daemon:
if [ -x /etc/rc.d/rc.apmd ]; then
   /etc/rc.d/rc.apmd stop
fi

With these modifications, the apmd now may be shut down in a manner consistent with other services running Slackware.

/etc/rc.d/rc.apmd

/etc/functions-colors

Finis.

Table of Contents