From owner-freebsd-questions@FreeBSD.ORG Wed Jun 6 22:45:46 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 58A5216A421 for ; Wed, 6 Jun 2007 22:45:46 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 046BA13C45B for ; Wed, 6 Jun 2007 22:45:45 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id l56Mf3Rn080108; Wed, 6 Jun 2007 18:41:03 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id l56Mf3VS080107; Wed, 6 Jun 2007 18:41:03 -0400 (EDT) (envelope-from jerrymc) Date: Wed, 6 Jun 2007 18:41:03 -0400 From: Jerry McAllister To: gmoniey Message-ID: <20070606224103.GA80072@gizmo.acns.msu.edu> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10982826.post@talk.nabble.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org 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: Wed, 06 Jun 2007 22:45:46 -0000 On Tue, Jun 05, 2007 at 11:00:07PM -0700, gmoniey wrote: > > as my luck would have it...this didn't work...i used your script...test it by > running ./rtest start & ./rtest stop and everything worked fine (note: i > changed the name from rails to rtest as rails is an actual command)... > > but when i rebooted nothing happened. I had the output dump to file and the > file was empty upon restart, which makes me believe it never actually ran.. You didn't even see the output from the echo command? Try sticking one in before the case statement so it would always run regardless of start or stop. > > Side Note: Jerry, the mongrel_rails command does spew some output, which is > why i dump it to file... OK. But do you know whether it writes that output to STDOUT or maybe to STDERR. If it is STDERR you will need a little different syntax than '>>' Something like '2>&1 >' filename > i even added the line rtest_enable="YES" in my /etc/rc.conf file and > rebooted, but still no luck.... > > thanks for your help fellas...i'll keep reading up as you suggested... > 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. ////jerry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #!/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 ;; stop) echo " <<- Running chkrc.sh with a stop argument" >> /tmp/chkrc.log ;; *) 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"