Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2007 18:41:03 -0400
From:      Jerry McAllister <jerrymc@msu.edu>
To:        gmoniey <gmoniey@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: startup / shutdown script (rc.d)
Message-ID:  <20070606224103.GA80072@gizmo.acns.msu.edu>
In-Reply-To: <10982826.post@talk.nabble.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>

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




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