Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 May 2007 15:24:01 -0400 (EDT)
From:      "Brian A. Seklecki" <lavalamp@spiritual-machines.org>
To:        freebsd-rc@freebsd.org, Vivek Khera <vivek@khera.org>
Subject:   Re: Apache-Style Profiles for FreeBSD ports/databases/slony/*
Message-ID:  <20070521143034.G5929@arbitor.digitalfreaks.org>
In-Reply-To: <4B255085-7629-4A98-AF24-465D6E48EB41@khera.org>
References:  <20070124163435.F18034@arbitor.digitalfreaks.org> <4B255085-7629-4A98-AF24-465D6E48EB41@khera.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070521143034.G5929>