From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 15:52:21 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49BAA16A419 for ; Wed, 6 Feb 2008 15:52:21 +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 EB3B713C4CE for ; Wed, 6 Feb 2008 15:52:20 +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 m16FmxCa019130; Wed, 6 Feb 2008 10:48:59 -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 m16FmxRn019129; Wed, 6 Feb 2008 10:48:59 -0500 (EST) (envelope-from jerrymc) Date: Wed, 6 Feb 2008 10:48:58 -0500 From: Jerry McAllister To: Zbigniew Szalbot Message-ID: <20080206154858.GD18883@gizmo.acns.msu.edu> References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <20080206163423.E4029@wojtek.tensor.gdynia.pl> <94136a2c0802060739l4cd1b290wc720339737079bb1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94136a2c0802060739l4cd1b290wc720339737079bb1@mail.gmail.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions Subject: Re: script to be executed on system startup. 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 Feb 2008 15:52:21 -0000 On Wed, Feb 06, 2008 at 04:39:40PM +0100, Zbigniew Szalbot wrote: > Hello, > > 2008/2/6, Wojciech Puchar : > > > (for example: "/etc/rc.d/myscript") > > > 2. chmod a+x the script > > > 3. you're done. > > > > > > This will work for the recent versions of FreeBSD (you didn't say for > > > which version do you need it). > > > > you need to make that script react for "start" and "stop" commands at > > least > > I just symlinked my sh script to /usr/local/etc/rc.d/ and it works > quite well without even touching rc.conf. If your script dosn't have need of any information or configuration from outside, then you don't need to put anything in /etc/rc.conf. But, it is available if you need it. As for start and stop, the system will pass start on a bootup and stop on a shutdown. It is appropriate to check at least for start in your script and only startup if it is set so you don't try to start it at shutdown. But, if there is something you would like to do at shutdown, then also make a section of the script for shutdown and then check for 'stop' and run that part when it is present and 'start' is not present. If both are set, then it is a bad error somewhere. ////jerry > > HTH > > Zbigniew Szalbot > _______________________________________________ > 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"