From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 17:52:29 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 BD18516A419 for ; Wed, 6 Feb 2008 17:52:29 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.227]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1A913C43E for ; Wed, 6 Feb 2008 17:52:28 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so2595691wxd.7 for ; Wed, 06 Feb 2008 09:52:28 -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:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=zIdAtA6zd8aYAYeroCiIvvK2cDLYhH14MXWQi0Pitc0=; b=ud5o2KhQ490JO5ErXyqLnNfpOYnxumIcpMDBi3SnTGWGxsVqlgOGJGlpZ1dt5R+dpCwG/ZPuN7NgEa0xkN3gmPOu+4NZtYZFXQf/AGBQQn+n21mrhDY0CPkdOS3gnfTYp+/t5Vw2fC3vLH1vQ9vhiZL6hVtXbKFjH09Z4ZiRTLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=tEsExNpkHaM30025rAh+1sLt8EWfkZwkO0mJcV/dZiBPCwbce4iFjDMdWNM5gKidiwYLW1+ZGUM44BdtOZitVLRUtrLdp8pdV+p58bDQCGkYoS6y8UGMKKTQXlXvWrA8BPKyCyUzRFakGJlljw1TAyIA+suTHnoNUn4n4bCW1Ck= Received: by 10.141.185.3 with SMTP id m3mr6824381rvp.236.1202320346585; Wed, 06 Feb 2008 09:52:26 -0800 (PST) Received: by 10.140.252.21 with HTTP; Wed, 6 Feb 2008 09:52:26 -0800 (PST) Message-ID: <9bbcef730802060952o178e654hbc0412127c7e887a@mail.gmail.com> Date: Wed, 6 Feb 2008 18:52:26 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Wojciech Puchar" In-Reply-To: <20080206163423.E4029@wojtek.tensor.gdynia.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <20080206163423.E4029@wojtek.tensor.gdynia.pl> X-Google-Sender-Auth: 8ae4c6d0ade4edf8 Cc: freebsd-questions@freebsd.org 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 17:52:29 -0000 On 06/02/2008, Wojciech Puchar wrote: > > (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 You *can*, but you don't *need* to, if in a hurry :) The script will be executed once at startup, and it can parse the "start" argument given to it, but it doesn't have to. Yes, it's somewhat dirty if you ignore start/stop arguments (and if you ignore them you can't rely on nice built-in features like "restart" internally executing stop, then start) but it works. I spent a few days playing with the rc.d mechanism and it's awesome.