Subject: Re: defaulting rc.d scripts to share/examples/rc.d
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 09/23/2004 16:58:59
On Fri, 24 Sep 2004, grant beattie wrote:

> > 1) /usr/pkg/etc/rc.d is the location for the examples to be installed.
> > Other config examples are installed to /usr/pkg/share/examples. This is
> > inconsistent.
> this implies that the supplied rc.d scripts are "examples", which is
> not entirely true.

I am not sure what you mean.

The variable is called "RCD_SCRIPTS_EXAMPLEDIR".

And we have an option (PKG_RCD_SCRIPTS=yes) that copies the script(s)

> > 2) pkgsrc users assume that /usr/pkg/etc/rc.d automatically works for
> > starting at boot. If the scripts were in "examples" directory they'd know
> > that they have to configure something extra.
> imho you shouldn't have to. you should just be able to tweak a knob
> and have things Just Work, using all of the rc.d scripts of currently
> installed pkgs.

Yes. We do have that. PKG_RCD_SCRIPTS=yes and put your variable in rc.conf
or rc.conf.d/${WHATEVER}. (It even works with pkg_add by using
PKG_RCD_SCRIPTS environment variable.)

> > 3) pkgsrc already has option to install from "examples" directory to real
> > rc.d directory. Most pkgsrc users don't know about it.
> that should be relatively simple to fix (and is related to having
> things Just Work), but is a separate issue to the location of the
> examples dir.

The fix is just telling the users. The implementation has been there for
at least a couple years.

> > 4) If you modify a rc.d script, your modifications could get removed or
> > lost on upgrade.

This is important. As it is now, your modified file will not be removed or
overwritten when properly using PKG_RCD_SCRIPTS.

> >
> > 5) Since the directory allowed customization before, it could be set to
> > outside of LOCALBASE and cause problems with packaging list.
> I use RCD_SCRIPTS_DIR=/etc/pkg/rc.d on a number of machines without
> this problem. the proper way of supplying rc.d scripts doesn't need
> them in the PLIST.

I guess you already are using PKG_RCD_SCRIPTS. Sorry I explained it above

I understand that they are not needed in the PLIST. I was the person who
committed that fix a few months ago. (And I had been using that for well
over a year.)

It makes sense to you, but now put your situation in front of someone
else: Your examples are in /usr/pkg/etc/rc.d and your real ones are in
/etc/pkg/rc.d. Sounds very confusing. That is like having the
etc examples under /usr/pkg/etc and your PKG_SYSCONFBASE as /etc/pkg. That
would be very confusing for many. By clearly naming the examples directory
"examples" all confusion is gone.

> it also seems that RCD_SCRIPTS_EXAMPLEDIR is already an absolute path,
> so ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR} would break things.

We already have that resolved in an off-list email. For others: As I
mentioned in my reply to Hubert, a pkgsrc user could set it outside of
LOCALBASE and then the PLIST would be broken due to the auto PLIST
registration. I tried to explain that, but not well. Sorry, this was

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links