From owner-freebsd-questions@FreeBSD.ORG Thu Mar 8 19:08: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 B18B416A403 for ; Thu, 8 Mar 2007 19:08:49 +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 7201A13C442 for ; Thu, 8 Mar 2007 19:08:49 +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 l28J5pPa027263; Thu, 8 Mar 2007 14:05:51 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id l28J5ppc027262; Thu, 8 Mar 2007 14:05:51 -0500 (EST) (envelope-from jerrymc) Date: Thu, 8 Mar 2007 14:05:51 -0500 From: Jerry McAllister To: Drew Jenkins Message-ID: <20070308190551.GA27233@gizmo.acns.msu.edu> References: <263543.26969.qm@web62205.mail.re1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <263543.26969.qm@web62205.mail.re1.yahoo.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Setting Env 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, 08 Mar 2007 19:08:49 -0000 On Thu, Mar 08, 2007 at 04:20:40AM -0800, Drew Jenkins wrote: > 20I wrote the following script (with your help) to solve the problem I'm having with setting the MySQL environment and getting Zope up after the fact. I have saved this in /usr/local/etc/rc.d/ If I run this after the machine reboots, all is well. If I simply let it run in the reboot sequence, it doesn't do it's job! The sleep command is to give the server a chance to finish all its other bootup sequences, since that appears to be the factor messing things up. But it doesn't work!! What can I do to tweak this to do what I need it to do? > TIA, > Drew > > #!/bin/sh > > sleep 60 > if [ -n "$LD_LIBRARY_PATH" ] ; then > export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib/mysql" > else > export LD_LIBRARY_PATH="/usr/local/lib/mysql" > fi > > cd /usr/local/zope/ > ./instance1/bin/zopectl stop > ./instance1/bin/zopectl start > ./instance2/bin/zopectl stop > ./instance2/bin/zopectl start > You don't suppose, if you made a file named 'rctest.sh' and put it in your /usr/local/etc/rc.d directory owned by root:wheel with execute permissions contain the following, that you might learn something? Then, take a look at /rctest.log after you reboot. ////jerry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #!/bin/sh # test writing a file echo "Starting rctest.sh at: `date`" >> /rctest.log case "$1" in start) echo "running rctest.sh with a start at: `date`" >> /rctest.log ;; stop) echo "Running rctest.sh with a stop at: `date`" >> /rctest.log ;; *) echo "Calling args for rctest.sh are start and stop" >> /rctest.log ;; esac sleep 3 echo "ending rctest.sh at: `date`" >> /rctest.log echo " " >> /rctest.log