From owner-freebsd-stable@FreeBSD.ORG Mon Jun 8 08:50:04 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428CA106567B for ; Mon, 8 Jun 2009 08:50:04 +0000 (UTC) (envelope-from utisoft@googlemail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id B22F28FC12 for ; Mon, 8 Jun 2009 08:50:03 +0000 (UTC) (envelope-from utisoft@googlemail.com) Received: by ewy8 with SMTP id 8so3884536ewy.43 for ; Mon, 08 Jun 2009 01:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=2WJVj7LkEf84EZTyUxFM4rOHGBtjwwkYeRJBBRo2t5o=; b=kyazRnE2Wj01GldYO5MoS2FDzYbTbfkhuM/9EPbTI2ArC+Pu3zYxS3Oa59fnYtv+OB OMWQOCFyjryZ5Ujb99ACnzDsLOVMFdUF8KShgN2cFwLvvvoHAsbdX880SXTcEBK5MLfu ae2YHoHX94u4UhIEuxwtPxxV3tWI/WWKnZDPI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; b=LuG4TnHC19AfFvJf+gEOfrho1UsyjDklHK7NXNFvwgo8yyI+xU7paVrXYF1KNcPtYB 5GneOLNifyzxlpuqC+RYbQnEn3IVb/D+pzIzJ396MToZOCvYsLs+fmBa2eDW/eqrxLeN Vu0pN9Od26RvcokmYZv8jzuZ3MEGd5EsUdeRE= MIME-Version: 1.0 Received: by 10.216.28.198 with SMTP id g48mr2210714wea.109.1244451002289; Mon, 08 Jun 2009 01:50:02 -0700 (PDT) In-Reply-To: <20090607222110.GA18662@lava.net> References: <143776.42704.qm@web34307.mail.mud.yahoo.com> <20090607183035.GA22240@lava.net> <20090607222110.GA18662@lava.net> From: Chris Rees Date: Mon, 8 Jun 2009 09:49:42 +0100 Message-ID: To: Scott Ullrich , utisoft@gmail.com, AES , freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: I need to add commands that starts every time at system boot. X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: utisoft@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 08:50:05 -0000 2009/6/7 Clifton Royston : > On Sun, Jun 07, 2009 at 04:12:41PM -0400, Scott Ullrich wrote: >> On Sun, Jun 7, 2009 at 3:36 PM, Chris Rees wrote= : >> > 2009/6/7 Clifton Royston : >> > >> >>=A0If you feel you just *can't* do it via a script in >> >> /usr/local/etc/rc.d, which is the better way, add a script called >> >> /etc/rc.local and that will be run after all the other start-up steps= . >> > >> > What's wrong with rc.local? >> >> Probably stems from this discussion: >> http://lists.freebsd.org/pipermail/freebsd-stable/2007-July/035996.html > > =A0No, I hadn't actually seen that discussion before. > > =A0I used to work on BSD/OS, which had only the rc.local mechanism, and > when I first switched over to FreeBSD it was what I used. =A0Eventually I > got my head around the /etc/rc.d and /usr/local/etc/rc.d mechanism and > found it distinctly superior, so now I use it almost exclusively. > > =A0Major highlights as to why are: > > =A0* You can readily implement whatever additional operations your servic= e > =A0 should support, such as restart/shutdown/whatever; > =A0* you can add or remove different services as discrete entities, > =A0 without having to merge their change or removal into a single text > =A0 file; > =A0* the startup/shutdown script can therefore readily be packaged for > =A0 removal/installation together with any other software for the > =A0 service in question; > =A0* you can get your service or operation run in a specific order > =A0 relative to other services; > =A0* you can use the same script to start, shutdown, or restart the > =A0 service at another time if appropriate or necessary > > =A0It used to be a little harder to write them than a few lines in > rc.local, but now sourcing rc_subr provides shell functions which make > it trivial. > > =A0These days I only use rc.local if I need to do some kind of > non-critical quick hack, e.g. for troubleshooting a problem. > =A0-- Clifton > > -- > =A0 =A0Clifton Royston =A0-- =A0cliftonr@iandicomputing.com / cliftonr@la= va.net > =A0 =A0 =A0 President =A0- I and I Computing * http://www.iandicomputing.= com/ > =A0Custom programming, network design, systems and network consulting ser= vices > Nice, thanks a lot, didn't know about rc_subr. Thanks Scott too. Chris --=20 A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in a mailing list?