From owner-freebsd-questions Sun Mar 3 12:57:10 2002 Delivered-To: freebsd-questions@freebsd.org Received: from sage-one.net (adsl-64-219-20-209.dsl.crchtx.swbell.net [64.219.20.209]) by hub.freebsd.org (Postfix) with ESMTP id 2692E37B400 for ; Sun, 3 Mar 2002 12:57:06 -0800 (PST) Received: from SAGEONE (sageone [192.168.0.5]) by sage-one.net (8.11.6/8.11.6) with SMTP id g23Kv5p13704 for ; Sun, 3 Mar 2002 14:57:05 -0600 (CST) (envelope-from admin@sage-one.net) Message-Id: <3.0.5.32.20020303145703.011a8260@mail.sage-one.net> X-Sender: admin@mail.sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Sun, 03 Mar 2002 14:57:03 -0600 To: freebsd-questions@freebsd.org From: Server Admin Subject: Help needed with UPS startup script Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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: !/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} 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