From owner-freebsd-questions@FreeBSD.ORG Thu Mar 8 16:58:55 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 C53EB16A400 for ; Thu, 8 Mar 2007 16:58:55 +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 89DA913C491 for ; Thu, 8 Mar 2007 16:58:55 +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 l28Gtvt6026706; Thu, 8 Mar 2007 11:55:57 -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 l28Gtvoc026705; Thu, 8 Mar 2007 11:55:57 -0500 (EST) (envelope-from jerrymc) Date: Thu, 8 Mar 2007 11:55:57 -0500 From: Jerry McAllister To: Drew Jenkins Message-ID: <20070308165557.GA26642@gizmo.acns.msu.edu> References: <343573.33221.qm@web62214.mail.re1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <343573.33221.qm@web62214.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 16:58:56 -0000 On Thu, Mar 08, 2007 at 08:31:23AM -0800, Drew Jenkins wrote: > ----- Original Message ---- > From: Garrett Cooper > To: freebsd-questions@freebsd.org > Sent: Thursday, March 8, 2007 11:09:13 AM > Subject: Re: Setting Env > > > Well, it's going to involve a bit more than that to get an rc script up > > and running I'm afraid.. the script needs a start, stop, status > > functions, as well as a few others. Some examples are in the /etc/rc.d > > and /usr/local/etc/rc.d directories, as you've discovered. > > > > Given your output above, maybe you want to add the LD_LIBRARY_PATH lines > > to the zopectl file? > > Brilliant! Why doesn't *that* work?! This is crazy! I even added your little script and, after it booted, tried running that directly (after stopping Zope) and it _still_ didn't work! That makes no sense to me at all! I put together a little script, as I stated earlier, that set the env, stopped and started my Zope instances (calling on zopectl), and *that* worked, so why doesn't this work?? That whole bin dir in Zope is owned by root, so how is running that script different than, as root, setting the env? Insane! > Drew I think this is really changing to getting a script to run at boot time from its previous 'setting env'. Anyway, I suggest first just working on getting any script to run at boot time - or rather at the time the system comes up for multi- user, but that stuff does not run when it comes up to single-user. So, my next suggestion is to make any little ole script with a couple of echo-s in it to demonstration that it runs and put that it the /usr/local/etc/rc.d directory with the correct permissions and name, etc. NOTE, someone in an earlier post clarified the .sh issue with information that was new to me about the system looking for certain flags inside the file if the file name does not have the .sh ending. Go back and check that out, but the this, assume you have to have .sh and execute permission. You do not have to have a start/stop/restart check in the script if the script will always just run regardless of parameter. But, what the system does is call the script with a parameter of 'start' at boot time and a parameter of 'stop' at shutdown time. But for the sake of the primative test, those can be omitted. Let's say you call the scriptfile: 'rctest.sh' Put something like: #!/bin/sh echo "running rctest.sh, got this far" # Add any any other stuff you want to test echo "running rctest.sh, finished" Now, if the bare skeleton works, then start adding more parts to it until you get to where everything works. Add more echo-s if they are useful. You could also look up how to get your messages written to a log file. ////jerry > _______________________________________________ > 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"