From owner-freebsd-questions Fri Jul 19 4:11:10 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0206237B400 for ; Fri, 19 Jul 2002 04:11:07 -0700 (PDT) Received: from catflap.home.slightlystrange.org (host217-39-153-84.in-addr.btopenworld.com [217.39.153.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3177443E31 for ; Fri, 19 Jul 2002 04:11:06 -0700 (PDT) (envelope-from dan@slightlystrange.org) Received: from danielby by catflap.home.slightlystrange.org with local (Exim 3.36 #1) id 17VVf0-0003yq-00 for freebsd-questions@FreeBSD.ORG; Fri, 19 Jul 2002 12:10:58 +0100 Date: Fri, 19 Jul 2002 12:10:58 +0100 From: Daniel Bye To: freebsd-questions Subject: Re: Need help with apcupsd startup script Message-ID: <20020719111058.GB14557@catflap.home.slightlystrange.org> Reply-To: dan@slightlystrange.org Mail-Followup-To: freebsd-questions References: <3D37F0E2.3080902@intersonic.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D37F0E2.3080902@intersonic.se> User-Agent: Mutt/1.4i X-Scanner: exiscan *17VVf0-0003yq-00*6/5jWojD34Q* (SlightlyStrange.org, Using NOD32 http://www.nod32.com) 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 On Fri, Jul 19, 2002 at 12:58:42PM +0200, Per olof Ljungmark wrote: > Hi all, > > I am using apcupsd installed from ports with no mods. > apcupsd itself runs fine but the script /usr/local/etc/rc.d/apcupsd.sh > returns: > apcupsd.sh: Cannot determine the PREFIX > when I try it. > I assume there are some Linux specific paths in there? How are you calling the script? You must give the absolute path on the command line, or the first block (if ! ...) will make it bomb out with the error message. HTH Dan > First lines of the script goes: > > 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} > apcupsd_flags=${apcupsd_flags:-"--kill-on-powerfail"} > apcupsd_pidfile=${apcupsd_pidfile:-/var/run/apcupsd.pid} > apcupsd_lockfile=${apcupsd_pidfile:-/var/spool/lock/apcupsd.lock} > > thanks, > /per olof > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message