Subject: Re: /usr/pkg/etc/rc.d/*
To: None <current-users@netbsd.org>
From: Chuck Yerkes <chuck+nbsd@2003.snew.com>
List: current-users
Date: 03/25/2003 14:55:25
There are several ways to view the hierarchy:
One is:

$TOP/  etc/
       bin/
       libexec/
       lib/
       sbin/
       share/
       and the rest/

I've certainly spent time with faux packaging (eg GNU Stow) and
installing things in /usr/local/.Packages/gcc/ {etc,bin,sbin,...}
and symlinking those up so /usr/local/bin/gcc pointed to the .Packages
are.

It's ugly, but in SunOS 4 timeline, it was the fast way to keep files
separated and vaguely managable.  When auto-conf let us compile and
install with differetn PREFIXs, it was easy.  And I could use
ls -l /usr/local/bin/gif2tiff
and get
gif2tiff   -> ../.Packages/tiff-v3.5.7/bin/gif2tiff


really basic package management.

Nice part?  export $PREFIX (aka /usr/local/) to other machines with
a like architecture and it works.


pkgsrc (and rpm and most real package management) keep a database
of some sort (/var/sadm/install or /var/db/pkg/*/+CONTENTS, etc)
and let us have advanced features.


Now, alternatives might break up our hierarchy described above.
SunOS puts things like binaries in lib (/usr/lib/sendmail - ick),
pipes, .pids and links to binaries in /etc/ (ick).  In Solaris they didn't
fix it.  4.4BSD brought us /var/run/ for "since the reboot" files - a /tmp
for root only.

/etc/ should contain only configuration files (where "configuration"
      is a bit broad).

That's good.


If pkgsrc starts to use not /usr/pkg/etc/, but rather /etc/pkg/
we change some things.
1) a clean (nfs) export of /usr/pkg/ won't work quite the same.
   You'd also want to mount /etc/pkg/ or keep it in sync.
   Doable, but not ideal.

   But my perhaps important and secure data isn't NFS exported!

   I don't really use NFS these days on non-desktop systems for
   this.  Disks are so large ANYHOW, that I usually find myself
   looking at 10-20GB of space on boot disks (vs. data disks).

2) we have config information in ONE HIERARCHY.  I *hate* hunting
   around the tree to find this stuff.  Using SASL?  Oh, the db
   might be in /usr/local/etc/ or /usr/pkg/etc/ or god knows where.
   If it's in /etc/pkg/sasldb (or /etc/sasl/sasldb), then I can
   worry about securing that one hierarchy.
    Sorry, been burned by Sun's odd habits of making /usr/ group
   writable and such.


I put my net-snmp stuff in /etc/snmpd/  (more than 3 files gets it
it's own directory).  ssh stuff is in /etc/sshd/.

OpenBSD, which I'm more comfortable and familar, does this. It's on
of the things I like about it.


Modern (post 1996) package management allows me to not be rigid
to keeping everything under one branch of the directory tree.
Package management can let me put snmpd.conf in /etc/snmpd/
and binaries in /usr/pkg/sbin/.  It's ok.

I can start to bend the system to serving ME, the admin.
This is juicy goodness.


Now the rc.d/ stuff can work.
No more "hunt the config files", I configure everything in one area.
Now it's more secure (or more easily secured).