From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 15:54:49 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 E207816A418 for ; Wed, 6 Feb 2008 15:54:49 +0000 (UTC) (envelope-from zszalbot@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id 59DD213C448 for ; Wed, 6 Feb 2008 15:54:49 +0000 (UTC) (envelope-from zszalbot@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so823100nfb.33 for ; Wed, 06 Feb 2008 07:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=GkHVDJO3l6trse31NvnoSu7hKhagmnc6NfJJuApCHY4=; b=mdsCANkj9KYDWgBCzU50hmsutvc54CPaNe5UxUJO8duQ1YUW7vkaOaEd8U91hirWqHc0t5PN3auQJS4aBdgbhKXPMKd67pSGeEsIueE+u9MkiF79Ra8RCGMQXjMwnqLUo1XokWWckUi+/rlQLriC0jWgiXqf+f3CnpP+qoqMjOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sbyh2Nz/FvUIIqjkxlkB2bUT101sy0ZdtfRE9z2E/JbvO9aNPHZLjQsVaDEYpP1+yb6MGRnz91zgDibsicibLaeffAZCMV3zdN50HBJVRJ1NVc2iOllaBQcjinRGcC6h5KSVdCUY0KqmdaiIGuMpEKfWY4l09j5P+0oc7iHAkNY= Received: by 10.78.161.4 with SMTP id j4mr10835742hue.10.1202313287452; Wed, 06 Feb 2008 07:54:47 -0800 (PST) Received: by 10.78.130.5 with HTTP; Wed, 6 Feb 2008 07:54:47 -0800 (PST) Message-ID: <94136a2c0802060754k601dcd87x464e32a5453c9c4b@mail.gmail.com> Date: Wed, 6 Feb 2008 16:54:47 +0100 From: "Zbigniew Szalbot" To: freebsd-questions In-Reply-To: <20080206154858.GD18883@gizmo.acns.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <20080206163423.E4029@wojtek.tensor.gdynia.pl> <94136a2c0802060739l4cd1b290wc720339737079bb1@mail.gmail.com> <20080206154858.GD18883@gizmo.acns.msu.edu> 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:54:50 -0000 Hello, 2008/2/6, Jerry McAllister : > 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. Thank you Jerry - I find your posts very informative and valuable! As for my api, all other configs are defined in a separate properties file (including when and how it should die/stop), so it is enough for me. Zbigniew Szalbot