Subject: managing /usr/pkg/etc/rc.d
To: None <firstname.lastname@example.org>
From: Erik Osheim <email@example.com>
Date: 05/14/2003 00:35:33
Content-Type: text/plain; charset=US-ASCII; format=flowed
I've been running NetBSD-i386 1.6 on a server for about 6 months now,
and am really enjoying administering it. So far things seem really well
I recently noticed that I wasn't running the more recently updated sshd
from pkgsrc, but rather was using /usr/sbin/sshd. The reason for this
was the fact that the /etc/rc.d/sshd script defaults to using that
version. However, I wanted to be running the version from pkgsrc. I
immediately noticed a similar issue with bind/bind9.
After that, I had been setting sshd=NO in rc.conf, and then calling
/usr/pkg/etc/rc.d/sshd start explicitly in rc.local. However, I'm not
sure that is the best way to do things-- I'd like to manage all my
daemons from within rc.conf. So currently, I have set up symlinks
between /usr/pkg/etc/rc.d and /etc/rc.d to get the scripts I want, and
another symlink from /etc/ssh to /usr/pkg/etc/ssh, which is what the
pkgsrc version uses. Of course, I had to move the old sshd script to
I don't see any obvious problems with this scheme (except that a few of
my scripts are on the /usr partition instead of /)... but... what is
the generally advised method for going about managing this? What are
other people doing?
Here are the methods I can see:
1) Letting pkgsrc programs install into /etc/rc.d through the use of
the PKG_RCD_SCRIPTS flag in mk.conf. This doesn't get around situations
like sshd (I don't think openssh will install there by default, since
it also needs /usr/pkg/etc/ssh), but generally would probably work.
However, you don't immediately know which scripts are native and which
are from pkgsrc
2) Keeping pkgsrc programs' scripts in /usr/pkg/etc/rc.d, and
symlinking them to /etc/rc.d. This is what I'm doing now. The biggest
worry, I guess, is that the file is not actually in /etc if somehow you
can't mount /usr.
3) Calling /usr/pkg/etc/rc.d scripts from rc.local. This means that
there are two places instead of one for specifying daemons, but does
keep everything in its nice place, and avoids name-collisions like sshd.
This may seem like a trivial question. However, I definitely spent
months thinking I had upgraded bind and sshd through pkgsrc, when in
fact I was running the same old daemons through rc.conf. I'm assuming
that others encounter this too, which is why I'm asking.
-- Erik Osheim
P.S. I'm not currently subscribed to netbsd-users (just port-i386 and
port-macppc) so please cc me in any on-list replies. Thanks again!
content-type: application/pgp-signature; x-mac-type=70674453;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
-----END PGP SIGNATURE-----