Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jan 2012 22:50:02 -0500
From:      Michael Scheidell <scheidell@freebsd.org>
To:        <freebsd-tinderbox@freebsd.org>, <freebsd-ports@FreeBSD.org>, Thomas Abthorpe <tabthorpe@FreeBSD.org>
Subject:   tinderbox start issue/error
Message-ID:  <4F10FB6A.20201@freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F10FB6A.20201>