From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 19:59:21 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3270F16A41A for ; Sat, 6 Oct 2007 19:59:21 +0000 (UTC) (envelope-from jay.quest4@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id A44F413C44B for ; Sat, 6 Oct 2007 19:59:20 +0000 (UTC) (envelope-from jay.quest4@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so692903nfb for ; Sat, 06 Oct 2007 12:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:from:to:cc:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; bh=YwQs+fYMsicQi3pkSe45bdRYdODGuOyA/nYrDZ9N++Y=; b=Sqy6Jcp2ZqigOaD04sVTn7vEt76izIOGETbE6vRXhDk46Ctlw0fvA6mG9rMN6z2Bs/X/geb/ExJzDhPOI8PgjVzM7NeFxEXEsvHD/K2xoJEr43c4uL/3TmAXh2QwoQ18bMDVrZhgOnK+RFUV9XtJtrgTOHF//pSREoTne7ioZtE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:cc:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=QzMj7OPXwZgoIvj2wRtSeNp8Lyjhp5Lm65lNMjTcLxx+G+QHVIICgwxQwJQLDFAMeVzJ9jpYmJBUgGnV76YETFGo4LihjkF7jaWP96zCx81kBCxu8ExagdQ7WMLM7n4efU/+kaBrCAom4B3He4PTkZn8J2t1/MG3UOyoZMPRytM= Received: by 10.78.204.20 with SMTP id b20mr9410067hug.1191699021813; Sat, 06 Oct 2007 12:30:21 -0700 (PDT) Received: from 4BANKS ( [12.5.189.253]) by mx.google.com with ESMTPS id d26sm587010nfh.2007.10.06.12.30.14 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Oct 2007 12:30:17 -0700 (PDT) Message-ID: <005601c8084f$526c3180$90bd050c@4BANKS> From: "Jay Banks" To: References: <004d01c80830$5447e770$90bd050c@4BANKS> <20071006171455.GA71986@terra.mike.lan> Date: Sat, 6 Oct 2007 14:30:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Cc: Mike Makonnen Subject: Re: Getting a script to run at boot X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2007 19:59:21 -0000 > A few things would help diagnose this problem: > o FreeBSD version Basic stock install of FreeBSD 6.2 > o output with rc_debug=yes in /etc/rc.conf Oct 6 13:24:03 12 root: /etc/rc: INFO: checkyesno: sntop_enable is set to YES. Oct 6 13:24:03 12 root: /etc/rc: INFO: pid file (/var/run/sntop.pid): not readable. Oct 6 13:24:03 12 root: /etc/rc: INFO: run_rc_command: evaluating echo "Startin g sntop."; /usr/bin/nice -5 /usr/local/bin/sntop -d -r 30 -f /etc/sntoprc/sntoprc -w -e /usr/home/mysites/www/data/etb/index.html (). > o the output of: ls -l /usr/local/etc/rc.d -r-xr-xr-x 1 root wheel 2086 Jun 26 10:12 apache21.sh -rwxr-x--x 1 root wheel 683 Aug 15 18:36 mpd4.sh -rwxr-x--x 1 root wheel 682 Jul 31 08:36 mpd4.sh.sample -r-xr-xr-x 1 root wheel 1659 Jun 26 14:13 mysql-server -r-xr-xr-x 1 root wheel 670 Jun 26 10:39 proftpd -rwxr-xr-x 1 root wheel 2130 Aug 16 12:33 radiusd.sh -rwxr-xr-x 1 root wheel 2130 Aug 16 12:31 rc.radiusd -rwxr-xr-x 1 root wheel 516 Oct 6 07:15 sntop > o the contents of the local_startup knob > i.e: grep local_startup /etc/defaults/rc.conf /etc/rc.conf /etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. > Is the above duplication a 'copy&paste' mistake or is it really in > the script? If so, this may be your problem right here. Not sure how it happend, but it just a copy & paste mistake. That would be too easy. The script came from here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-starting-services.html I just changed "utility" to "sntop" and adjusted the command line accordingly. >> If I change directory to /usr/local/etc/rc.d and do: >> >> perl sntop.sh start > > why perl? I don't know. "./sntop start" produces the same results > This may mean that the program didn't damonize. If it didn't then > obviously > it will terminate when you terminate the terminal you started it from. Do > you get your prompt back after you run this command? No I don't. The script specifically has a command line to run as a dameon: -d, --daemon - daemon mode: make sntop capable of running in the back- ground. note, it wont automatically fork into the background. If I remove -d from the flags in /etc/rc.conf, the script will just display to the terminal screen. When I put -d back in, it will run and output the html file, refreshes when it is supposed to, and everything looks good, but I do not get the prompt back afterwards. When I reboot, the html output file is wiped out and contains no data, and the process does not show up in the running processes. What exactly does, "it wont automatically fork into the background," mean? > Cheers, > Mike. Thanks for looking at it. Jay Banks