Subject: Re: CVS commit: pkgsrc/net/pxe/files
To: NetBSD Packaging <tech-pkg@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-pkg
Date: 11/07/2001 11:16:51
>> >Maybe we should create a /conf for the user-changed config files, and move
>> >that kind of stuff there. We could symlink from /etc for compatability.
>> >But this is getting into a different discussion....
>> 
>> what's wrong with replacing the thing the pkg looks at with a symlink
>> that points to a file in /etc?  that way, *all* your config files
>> actually live in /etc, and if you need to, you can add more symlinks
>> later, in different places, to use the same config files for (eg)
>> newer versions of the pkg.
>
>I've done this to a certain extent, and it's annoying as all heck.
>Here's an example problem:
>
>I want to start thttpd on boot, but I think putting everything I want to
>install from pkgsrc in /etc/rc.local is tedious.  So, I add "thttpd=YES"
>to /etc/rc.conf.  That does nothing because rc reads only /etc/rc.d, not
>/usr/pkg/etc/rc.d and /usr/X11R6/etc/rc.d if they exist.  So I symlink
>/usr/pkg/etc/rc.d/thttpd to /etc/rc.d/thttpd.  That generates errors,
>because /usr isn't mounted when rcorder is run.  So, I move
>/usr/pkg/etc/rc.d to /etc/rc.d-pkg, symlink /usr/pkg/etc/rc.d to
>/etc/rc.d-pkg, and symlink /etc/rc.d-pkg/* into /etc/rc.d; same for
>X11R6.  Now, and with suitable "blah=NO" defaults generated for the
>packages that have things in an rc.d that I don't want to run, it works
>without errors.
>
>Am I doing this right?  Is there a FAQ I missed?  How do other people do
>this?

maybe add this to rc.local?

	files=`rcorder -s nostart /usr/pkg/etc/rc.d/* /usr/local/etc/rc.d/*`
	for _rc_elem in $files; do
		run_rc_script $_rc_elem start
	done

then this stuff will get run after all your file systems are mounted,
but you don't need any crazy glue to handle it.

>If /etc/mk.conf had a CONFDIR variable, defaulted to /usr/pkg/etc, then
>that would allow most people the flexibility to change things as they
>see fit.  The small number of packages that replace or duplicate base
>system functionality (postfix, sendmail, ssh, host..) are special cases,
>but pkgsrc-land should all be kept in /usr/pkg.  

i was only suggesting that you put symlinks in /usr/pkg/etc that
pointed to /etc for the config files for things from pkgsrc, not for
the startup stuff.  if you need it started up, toss in a small generic
mechanism like the above.

><tangent>
>
>By the same token, given pkgsrc's special duplication of certain
>components of the base system, doesn't it make sense to integrate those
>into the boot process if they exist?
>
></tangent>

well...ideally, yes, but it's tricky since someone may or may not have
installed a given pkg.  let's see...postfix, sendmail, qmail, named,
djbdns...tricky.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."