Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Mar 2002 14:57:03 -0600
From:      Server Admin <admin@sage-one.net>
To:        freebsd-questions@freebsd.org
Subject:   Help needed with UPS startup script
Message-ID:  <3.0.5.32.20020303145703.011a8260@mail.sage-one.net>

next in thread | raw e-mail | index | archive | help
FreeBSD sage-one.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb  6 10:07:36
CST 2002     sageame@sage-one.net:/usr/obj/usr/src/sys/SAGEKERNEL  i386

Good afternoon:
Just installed apcupsd daemon from ports for APC Smart-UPS and have
everything else (I think) running online fine, EXCEPT the
"/usr/local/etc/rc.d/apcupsd.sh" boot startup script. The script dies at
the beginning because it "Cannot determine the PREFIX" ...figured path is
wrong and is for Linux structure.

I'm not a scripter but have tried & tried to modify the top line to
properly define the PREFIX, but no luck. Help would be REALLY be
appreciated on how to modify "PREFIX=" properly. Here's the top portion of
the script with the other lines calling for the PREFIX:

</snip>
!/bin/sh
# $FreeBSD: ports/sysutils/apcupsd/files/apcupsd.sh.sample
# startup scripts for APCUPSD.
            
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
        echo "$0: Cannot determine the PREFIX" >&2
        exit 1
fi

# If there is a global system configuration file, suck it in.
if [ -r /etc/defaults/rc.conf ]; then
        . /etc/defaults/rc.conf
        source_rc_confs
elif [ -r /etc/rc.conf ]; then
        . /etc/rc.conf
fi

apcupsd_enable=${apcupsd_enable:-YES}
apcupsd_program=${apcupsd_program:-${PREFIX}/sbin/apcupsd}
</snip>

The last line should be able to find the daemon at:
/usr/local/sbin/apcupsd

Gotta have this so the daemon takes back control on reboot. Thanks in
advance for any help!!!
.... our website: http://www.sage-one.net/

Best regards,

Jack L. Stone
Server Admin

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020303145703.011a8260>