Technical article 105454

The UPS serial port monitoring daemon, ssd, doesn't automatically start when the system enters multiuser mode.

OpenServer 5.0.0OpenServer 5.0.2

Written · Last revised

Problem

"mkdev apc" is run to configure the system to start the UPS
(uninterruptible power supply) daemon "ssd" when the system
enters multiuser mode.  It creates the /etc/rc2.d/S99apcssd
script.  On the first change to multiuser mode, after configuring
this daemon, S99apcssd correctly starts the ssd daemon automatically.
However, on subsequent reboots or changes to multiuser mode, the
daemon fails to start. The console displays the message:

Only one copy of ssd may be running at a time APC UPS Monitoring Daemon active

Cause

The /usr/lib/apc/ssd binary writes out an ssd.pid lock file to
the current working directory on starting the daemon.  When the
/etc/rc2.d/S99apcssd startup script is run, it checks to see if
there is a daemon already running, by looking for the ssd.pid
file.  If it exists, then it will kill the process id (contained
in the file) and delete the ssd.pid file.  This allows the
/usr/lib/apc/ssd binary to run as a single instance.

The /etc/rc2.d/S99apcssd script is checking the apc install directory (/usr/lib/apc) for the ssd.pid file before deleting it, but the ssd binary writes the ssd.pid file to the current working directory. On startup, the /etc/rc2.d scripts are run from root's home directory, so the ssd.pid file gets written to /.

Therefore, the startup script fails to remove the lockfile in / but
when the ssd binary is called it detects the lockfile in / and
doesn't start the daemon.  It believes that an instance of the
daemon is already running when, in fact, one is not.

Solution

Once the system is in multiuser mode, the daemon can be manually started by the root user as follows:

cd /
rm ssd.pid
/etc/rc2.d/S99apcssd start
Confirm the daemon is running with:
ps -ef | grep ssd
You should see a line containing:
/usr/lib/apc/ssd /usr/lib/apc/ssd.ini

Alternatively, the startup script /etc/rc2.d/S99apcssd can be modified so that any references to the ssd.pid file refer to it in the root directory. This would allow the system to automatically start the daemon on reboot or a change to multiuser mode. The script would read as follows:

#!/bin/sh
# @(#)S99apcssd 25.2 94/10/14
#         Copyright 1994, American Power Conversion, Inc.
ACTIVITY_STRING=
INSTALL_PATH=/usr/lib/apc
CONFIG_FILE=ssd.ini
kill_it() {
        set `cat /ssd.pid`
        kill -INT $1 1>/dev/null 2>&1
case "$1" in
start)
        if [ -r $INSTALL_PATH/ACTIVE ]
        then
                ACTIVITY_STRING="ACTIVE"
                if [ -s /ssd.pid ]
                then
                        kill_it;
                        rm -f /ssd.pid
                fi
                $INSTALL_PATH/ssd $INSTALL_PATH/ssd.ini &
                echo "APC UPS Monitoring Daemon active"
        else
        ACTIVITY_STRING="INACTIVE"
        fi
stop)
        if [ -r /ssd.pid ]
        then
                kill_it;
        fi
echo "Usage S99apcssd [start|stop]"
esac
NOTES:    The /usr/lib/apc/ssd daemon can be started from any current
          working directory but you will need to keep an eye on the ssd.pid
          file, which gets written out to that directory.

This problem has been reported to SCO Engineering and is scheduled to be addressed in a future release.

From the Xinuos technical article database, record 105454. Reproduced with permission. The original is at www.sco.com/ta/105454, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.