From owner-freebsd-tinderbox@FreeBSD.ORG Sat Jan 14 03:50:05 2012 Return-Path: Delivered-To: freebsd-tinderbox@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9ED106566C; Sat, 14 Jan 2012 03:50:05 +0000 (UTC) (envelope-from scheidell@freebsd.org) Received: from mx1.secnap.com.ionspam.net (mx1.secnap.com.ionspam.net [204.89.241.253]) by mx1.freebsd.org (Postfix) with ESMTP id 641BC8FC15; Sat, 14 Jan 2012 03:50:05 +0000 (UTC) Received: from mx1.secnap.com.ionspam.net (mx1.secnap.com.ionspam.net [10.70.1.253]) by mx1.secnap.com.ionspam.net (Postfix) with ESMTP id D7A7C621C0D; Fri, 13 Jan 2012 22:50:04 -0500 (EST) X-Virus-Scanned: SpammerTrap(r) VPS-1500 2.17 at mx1.secnap.com.ionspam.net Received: from USBCTDC001.secnap.com (usbctdc001.secnap.com [10.70.1.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.secnap.com.ionspam.net (Postfix) with ESMTPS id 3C069621C05; Fri, 13 Jan 2012 22:50:04 -0500 (EST) Received: from MikeBook-Air.local (10.80.0.4) by USBCTDC001.secnap.com (10.70.1.1) with Microsoft SMTP Server (TLS) id 14.0.722.0; Fri, 13 Jan 2012 22:50:03 -0500 Message-ID: <4F10FB6A.20201@freebsd.org> Date: Fri, 13 Jan 2012 22:50:02 -0500 From: Michael Scheidell Organization: SECNAP Network Security Corp User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.20) Gecko/20110804 Thunderbird/3.1.12 MIME-Version: 1.0 To: , , Thomas Abthorpe Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: tinderbox start issue/error X-BeenThere: freebsd-tinderbox@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Tinderbox reports, responses, and meta-comments" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 03:50:05 -0000 while testing a 'pre_start()' option for tinderbox, I came across an issue. (I backed out my patches to check) tinderbox can be started, over, and over, and over, with no errors warning that it is already running. is this the expected behavior? (and you don't need root!) %service tinderbox status 85793 85794 %service tinderbox start %sudo service tinderbox start %sudo service tinderbox status tinderd is running as pid 85793 85794 85893 85894 78931 78932. %sudo service tinderbox start %sudo service tinderbox status tinderd is running as pid 85793 85794 85893 85894 86001 86002 78931 78932. %pwd /usr/local/etc/rc.d %cd /etc/rc.conf.d %sudo rm tinderbox new %service tinderbox start %service tinderbox status tinderd is running as pid 85793 85794 85893 85894 86001 86002 86169 86170 78931 78932. grep tinder /etc/rc.conf tinderd_enable="YES" tinderd_directory=/disk1/tinderbox/scripts tinderd_instances=2 is it because of the tinderd_instances=2? (note, each 'start' started two) noop, (but, deleting that line lets me start another one) service tinderbox status tinderd is running as pid 85793 85794 85893 85894 86001 86002 86169 86170 78931 78932. %service tinderbox start %service tinderbox status tinderd is running as pid 85793 85794 85893 85894 86001 86002 86169 86170 87716 78931 78932. is this the expected behavior? non root can start it? you can start it, over and over and over? is this a solution for both? --- /tmp/tinderbox 2012-01-12 10:32:24.000000000 -0500 +++ ./tinderbox 2012-01-13 22:42:44.000000000 -0500 @@ -41,7 +41,19 @@ fi start_cmd="${name}_start" - +start_precmd="${name}_prestart" +tinderd_prestart() +{ +if pgrep -f ${command} >/dev/null +then + err 1 ${command} already running +fi +ID=`id -u` +if [ ${ID} -ne 0 ] +then + err 1 must be run as root +fi +} tinderd_start() { for i in `jot - 1 ${tinderd_instances}`; do -- Michael Scheidell, CTO o: 561-999-5000 d: 561-948-2259 >*| *SECNAP Network Security Corporation * Best Mobile Solutions Product of 2011 * Best Intrusion Prevention Product * Hot Company Finalist 2011 * Best Email Security Product * Certified SNORT Integrator