From owner-freebsd-rc@FreeBSD.ORG Mon May 21 19:40:06 2007 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B59916A421 for ; Mon, 21 May 2007 19:40:06 +0000 (UTC) (envelope-from lavalamp@spiritual-machines.org) Received: from mail.digitalfreaks.org (arbitor.digitalfreaks.org [216.151.95.158]) by mx1.freebsd.org (Postfix) with ESMTP id 0730213C457 for ; Mon, 21 May 2007 19:40:05 +0000 (UTC) (envelope-from lavalamp@spiritual-machines.org) Received: by mail.digitalfreaks.org (Postfix, from userid 1022) id CDF20172EC; Mon, 21 May 2007 15:24:01 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.digitalfreaks.org (Postfix) with ESMTP id CCCEB172EB; Mon, 21 May 2007 15:24:01 -0400 (EDT) Date: Mon, 21 May 2007 15:24:01 -0400 (EDT) From: "Brian A. Seklecki" X-X-Sender: lavalamp@arbitor.digitalfreaks.org To: freebsd-rc@freebsd.org, Vivek Khera In-Reply-To: <4B255085-7629-4A98-AF24-465D6E48EB41@khera.org> Message-ID: <20070521143034.G5929@arbitor.digitalfreaks.org> References: <20070124163435.F18034@arbitor.digitalfreaks.org> <4B255085-7629-4A98-AF24-465D6E48EB41@khera.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: Apache-Style Profiles for FreeBSD ports/databases/slony/* X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Mon, 21 May 2007 19:40:06 -0000 Before we slip this in (I can have a clean version ready for 1.3), I had an architectural question about two RC variables for the -rc list.B $[command_]flags v.s $[command_]args. What is the architectural purpose of each? Override? Append? Prepend? I've looked at a bunch of scripts and they're used interchangeably in many 3rd party ports scripts. It would seem: rc.subr(8) we run: $command $rc_flags $command_args I'm creating an Apache-profile-style script for Slony. Use of profiles enables some modifications to the default $command_args (appending "-${profilename}" to the PID and conf file location, etc.). However, I'd like the user/admin to be able to do *both*: 1) Append or prepend thier own flags to the auto-generated ones 2) Override the auto-generated flags entirely on a per-profile basis! What I was thinking I should have is: 1) $command_args within the RC script sets the defaults for non-profile config. 2) $slon_flags in rc.conf(5) allows overriding of non-profile defaults 3) Each profile uses $slon_[profilename]_flags inherited from $command_args 4) $slon_[profilename]_flags would normally be automatically generated within RC script (adjusted PID / Conf file defaults) --- This is where I need some guidance -- 5a) Presence of $slon_[profilename]_flags in rc.conf(5) overrides the RC script auto generation. $command_args is disregarded entirely if $slon_[profilename]_flags is defined. ---- OR ---- 5b) Presence of $slon_[profilename]_flags in rc.conf(5) is appended or prepended to $slon_[profilename]_flags automatically generated in RC script. ---- OR --- 5c) Presence of $slon_[profilename]_flags in rc.conf(5) overrides the RC script auto generation. In most circumstances, not specified. Use $slon_[profilename]_args in rc.conf(5) to append or prepend auto- generated values. It would seem that in _most_ instances, users may override in-RC-script generated flags/args by using $command_flags which becomes _PREPENDED_ to the the $command_args. (Thinking: Most getopt(3) programs accept the first of duplicate flags?) It would also seem that that I have $rc_flags at my disposal -- contains a string, which is eval(1)'d into another variable name for $command_flags / ${name}_flags. Anyway, it seems like there should be a standard here. And no doubt I'm being way too pragmatic. ~BAS Disregard the URL below that version is out of date. On Tue, 10 Apr 2007, Vivek Khera wrote: > > On Jan 24, 2007, at 4:43 PM, Brian A. Seklecki wrote: > >> >> http://digitalfreaks.org/~lavalamp/slon.in >> > > hey, i'm updating the slony port right now... is this safe to replace the > current slon startup script yet? > > i use daemontools for running my slons, so i'm not in a good position to test > it. > > thanks! > l8* -lava (Brian A. Seklecki - Pittsburgh, PA, USA) http://www.spiritual-machines.org/ "Guilty? Yeah. But he knows it. I mean, you're guilty. You just don't know it. So who's really in jail?" ~James Maynard Keenan