From owner-freebsd-rc@FreeBSD.ORG Sun Aug 8 16:26:49 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA15116A4CE for ; Sun, 8 Aug 2004 16:26:49 +0000 (GMT) Received: from web50302.mail.yahoo.com (web50302.mail.yahoo.com [206.190.38.56]) by mx1.FreeBSD.org (Postfix) with SMTP id 87DE843D1F for ; Sun, 8 Aug 2004 16:26:49 +0000 (GMT) (envelope-from cykyc@yahoo.com) Message-ID: <20040808162649.80859.qmail@web50302.mail.yahoo.com> Received: from [209.98.54.121] by web50302.mail.yahoo.com via HTTP; Sun, 08 Aug 2004 09:26:48 PDT Date: Sun, 8 Aug 2004 09:26:48 -0700 (PDT) From: Jon Passki To: freebsd-rc@freebsd.org In-Reply-To: <20040807214302.73783.qmail@web50307.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: Feature request to rc.d: managing subsets of scripts X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cykyc@yahoo.com List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2004 16:26:50 -0000 Gratuitous self-reply :-/ --- Jon Passki wrote: > Hello All, > > I wish accomplish the following with rc.d scripts: > > 1) Scripts can be assigned to a subset; > 2) Subsets can be ordered, with this order honored by rcorder; > 3) Subsets can be independently started and stopped after the > initial system startup; > > For me, the usage would be in situations where I have a bunch of > interdependent scripts that would need a stop/start when for > example I'm remounting a file system or reassigning daemons to a > different network interface. This way, I could assign scripts to > subsets if I know that they utilize common interfaces or mounts. > It is implied that if a script wasn't placed in a subset it > should > continue to function even though it may depend on or be a > dependent > of a subset that was stopped. It is the responsibility of the > sysadmin to properly segment subsets. > > 1) & 2) can be accomplished with the REQUIRE, PROVIDE and BEFORE > lines. This would also make me alter each rc.d script I wish to > manage, but that is acceptable. It's unknown to me if subsets > should be disjointed. > > It isn't obvious to me, though, if 3) could work that way. I > still > would see rcorder doing it's magic, but it would need a filter to > only order that subset. The KEYWORD line could be used in > addition > to the other lines, but adds some redundancy. According to [1], > rcorder logically OR's keep list switches. It would have to AND > them in this case to handle a) the FreeBSD switch and b) more > importantly, manage more than one subset. snippit for 3) subsets="zone1 internal external" for _i in ${subsets} do if [ -z "${_regexp}" ]; then _regexp="'^# KEYWORDS?:.*${_i}" else _regexp="${_regexp}|^# KEYWORDS?:.*${_i}" fi done _files=`eval "grep -El ${_regexp}' ${some_path}"` rcorder ${skip} ${_files} 2>/dev/null Thanks to Oliver Eikemeier for the KEYWORD string :-) Jon Passki p.s. This satisfies things for me. YMMV __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail