From owner-freebsd-questions@FreeBSD.ORG Thu Jun 7 07:29:49 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 36F7116A468 for ; Thu, 7 Jun 2007 07:29:49 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9B413C45D for ; Thu, 7 Jun 2007 07:29:48 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1HwCRI-0008QA-DW for freebsd-questions@freebsd.org; Thu, 07 Jun 2007 00:29:48 -0700 Message-ID: <11003239.post@talk.nabble.com> Date: Thu, 7 Jun 2007 00:29:48 -0700 (PDT) From: gmoniey To: freebsd-questions@freebsd.org In-Reply-To: <20070606224103.GA80072@gizmo.acns.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: gmoniey@gmail.com References: <10902043.post@talk.nabble.com> <20070601131230.380039e8@localhost> <10906324.post@talk.nabble.com> <20070601154223.GC43330@gizmo.acns.msu.edu> <10953687.post@talk.nabble.com> <20070605031224.188cacc8@gumby.homeunix.com.> <20070605022154.GB71220@gizmo.acns.msu.edu> <10963533.post@talk.nabble.com> <46651165.1040909@webanoide.org> <10982826.post@talk.nabble.com> <20070606224103.GA80072@gizmo.acns.msu.edu> Subject: Re: startup / shutdown script (rc.d) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2007 07:29:49 -0000 Jerry McAllister-2 wrote: > > Just as a test, I made the following sample script and named it chkrc.sh > and put it in /usr/local/etc/rc.d with execute permission. > It works just fine running from command line or as part of boot > or shutdown. You might try it as proof of concept and go from > there. Don't include the lines of dashes I put to deliminate it. > Start with the #!/bin/sh line and end with the blank echo line. > > I ran this script form the command line, and everything worked fine...so then i tried to run it after issuing a reboot command...and this was the output: Entering chkrc -- at: Wed Jun 6 23:22:19 PDT 2007 +>> running chkrc.sh with a start argument Leaving chkrc -- at Wed Jun 6 23:22:19 PDT 2007 kinda wierd that the stop command wasnt issued....but i am more concerned with the start command anyways...so i added my stuff to the file, which now looks like this: #!/bin/sh echo " Entering chkrc -- at: `date` " >> /tmp/chkrc.log case "$1" in start) echo " +>> running chkrc.sh with a start argument" >> /tmp/chkrc.log kldload accf_http >> /tmp/chkrc.log mongrel_rails cluster::start -v -C /usr/local/www/myapp/config/mongrel_cluster.yml >> /tmp/chkrc.log /usr/local/www/myapp/script/backgroundrb start ;; stop) echo " <<- Running chkrc.sh with a stop argument" >> /tmp/chkrc.log mongrel_rails cluster::stop -v -C /usr/local/www/myapp/config/mongrel_cluster.yml >> /tmp/chkrc.log /usr/local/www/myapp/script/backgroundrb stop ;; *) echo "Calling args for chkrc.sh are start and stop" >> /tmp/chkrc.log ;; esac echo " Leaving chkrc -- at `date`" >> /tmp/chkrc.log echo " " >> /tmp/chkrc.log and i rebooted...but the tmp file looked the same (i.e. same output as the example you gave me), and none of my processes were running...i also tested this script from the command line, and both the start and stop commands work correctly, and the results are outputted to the temp file as expected... i dont know that much about unix, but is it possible that other variables arent setup yet...and so my calls to mongrel_rails (which has a link in my /usr/local/bin)? i also changed the >> to expect STDERR, and still no luck... -- View this message in context: http://www.nabble.com/startup---shutdown-script-%28rc.d%29-tf3848895.html#a11003239 Sent from the freebsd-questions mailing list archive at Nabble.com.