From owner-freebsd-questions@FreeBSD.ORG Wed Dec 19 22:34:43 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50F175B5; Wed, 19 Dec 2012 22:34:43 +0000 (UTC) (envelope-from prvs=6935c9144=pschmehl_lists@tx.rr.com) Received: from ip-002.utdallas.edu (ip-002.utdallas.edu [129.110.20.108]) by mx1.freebsd.org (Postfix) with ESMTP id 112188FC1C; Wed, 19 Dec 2012 22:34:42 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoQCAMJA0lCBbgoggWdsb2JhbABErQuRCA4BARYmgwQCP4E+iCadTZp+kC9hA4hhjkWIMYoO X-IronPort-AV: E=Sophos;i="4.84,320,1355119200"; d="scan'208";a="112992025" Received: from zxtm01.utdallas.edu (HELO [129.110.200.11]) ([129.110.10.32]) by ip-002.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Dec 2012 16:34:29 -0600 Date: Wed, 19 Dec 2012 16:34:27 -0600 From: Paul Schmehl To: FreeBSD Questions List Subject: Can't get start_precmd to do *anything* Message-ID: <66E78C5BBEC1BC01C9A7E292@localhost> X-Mailer: Mulberry/4.1.0a1 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline; size=2203 Cc: FreeBSD RC List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 22:34:43 -0000 I'm working on an rc.d init script for a port, and I am clearly in need of a clue. I have a daemon that requires that a FIFO exist before it will start. The FIFO is defined in the daemon's conf file. I could just point that out to the user using "warn", but I thought it would be nicer to simply take care of it programmatically. So I created this: start_precmd="${name}_ck4fifo()" ${name}_ch4fifo() { . ${pads_agent_conf} echo "Checking to see if ${PADS_FIFO} exists......" if [ ! -p ${PADS_FIFO} ]; then echo "${PADS_FIFO} did not exist. Creating it now....." `/usr/bin/mkfifo ${PADS_FIFO} else echo "${PADS_FIFO} already exists." fi } When I run the init script with rc_debug enabled, it calls the start_precmd, but absolutely nothing happens. I don't even get the echos. # /usr/local/etc/rc.d/pads_agent onestart /usr/local/etc/rc.d/pads_agent: DEBUG: checkyesno: pads_agent_enable is set to YES. /usr/local/etc/rc.d/pads_agent: DEBUG: run_rc_command: start_precmd: pads_agent_ck4fifo() Starting pads_agent. /usr/local/etc/rc.d/pads_agent: DEBUG: run_rc_command: doit: /usr/local/bin/sguil-sensor/pads_agent.tcl -D -c /usr/local/etc/sguil-sensor/pads_agent.conf [root@buttercup4 /usr/ports/security/sguil-sensor-update/sguil-sensor]# Error: Unable to read /var/data/nsm/sguil-sensor/buttercup4.utdallas.edu/pads.fifo I even tried this but got the same result. ${name}_ch4fifo() { warn "You must create PADS_FIFO before starting ${name}." warn "Set PADS_FIFO in the ${pads_agent_conf} file." } The warn messages aren't in the messages file either, which is expected behavior. What the heck is going on here? Is something wrong with rc.subr on this host? Am I missing something? -- Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson "There are some ideas so wrong that only a very intelligent person could believe in them." George Orwell