From owner-freebsd-ports@FreeBSD.ORG Wed May 14 16:08:29 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D7BA106566B for ; Wed, 14 May 2008 16:08:29 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.20.110]) by mx1.freebsd.org (Postfix) with ESMTP id 6325A8FC12 for ; Wed, 14 May 2008 16:08:29 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id 0855023DEC for ; Wed, 14 May 2008 10:44:19 -0500 (CDT) Date: Wed, 14 May 2008 10:44:20 -0500 From: Paul Schmehl To: FreeBSD Ports Message-ID: <5270C739E0A7C92683E03AB7@utd65257.utdallas.edu> In-Reply-To: <20080514115626.GB69533@lor.one-eyed-alien.net> References: <14848575EFE82AE05B2027F2@utd65257.utdallas.edu> <20080514115626.GB69533@lor.one-eyed-alien.net> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: rc.d startup script problem X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2008 16:08:29 -0000 --On Wednesday, May 14, 2008 06:56:26 -0500 Brooks Davis wrote: > On Tue, May 13, 2008 at 02:35:54PM -0500, Paul Schmehl wrote: >> This script will not start if you change the name or location of the conf >> file in /etc/rc.conf. For some reason it's not parsing /etc/rc.conf. >> Anyone know why? >> >> # !/bin/sh >> >> # PROVIDE: sancp_agent >> # REQUIRE: DAEMON >> # KEYWORD: shutdown >> >> # Add the following line to /etc/sguil-sensor/rc.conf to enable sancp_agent: >> # sancp_agent_enable (bool): Set to YES to enable sancp_agent >> # Default: NO >> # sancp_agent_conf (str): Sensor_agent configuration file >> # Default: >> /usr/local/etc/sguil-sensor/sancp_agent.conf >> # >> >> . /etc/rc.subr >> >> name="sancp_agent" >> rcvar=`set_rcvar` >> command="/usr/local/bin/sguil-sensor/sancp_agent.tcl" >> procname="/usr/local/bin/tclsh8.4" >> pidfile="/var/run/${name}.pid" >> check_pidfile="${pidfile} ${procname} /bin/sh" >> >> [ -z "$sancp_agent_enable" ] && sancp_agent_enable="NO" >> [ -z "$sancp_agent_conf" ] && >> sancp_agent_conf="/usr/local/etc/sguil-sensor/sancp_agent.conf" >> [ -z "$sancp_agent_flags" ] && sancp_agent_flags="-D" >> >> [ -n "$sancp_agent_conf" ] && sancp_agent_flags="$sancp_agent_flags -c >> $sancp_agent_conf" > > This section needs to go below load_rc_conf so the variables are > reliably defined. Doh! Thanks Brooks. I knew it had to be something I'd overlooked. That one is dumb. > Also, command_args should generally be used instead of ${name}_flags. Thanks. I'll start using that. -- Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/