At Fri, 25 Jul 2025 12:43:18 +0530, Mayuresh <mayuresh%acm.org@localhost> wrote: Subject: Re: What's the norm /usr/pkg/etc/rc.d vs /etc/rc.d for pkg daemons? > > On Fri, Jul 25, 2025 at 08:28:36AM +0200, Thomas Klausner wrote: > > Only /etc/rc.d is considered by default on system bootup. See > > /etc/defaults/rc.conf and in particular the rc_directories variable > > and the comment above. > > pkgsrc sources have two patterns: > > e.g. > > security/heimdal/files/kpasswdd.sh: > > . /etc/rc.subr > > www/lighttpd/files/lighttpd.sh > > $_rc_subr_loaded . @SYSCONFBASE@/rc.subr > > If I am a packager which of these two shall I choose? The latter? @SYSCONFBASE@ isn't well documented (so far as I can see, especially not in the main pkgsrc guide), but it should be the path to the base system's configuration directory, normally it is "/etc", but it is modifiable by setting CROSS_SYSCONFBASE. > Would be nice if this aspect were uniform across packages. As a user now > I have to handle it in a package specific way. (Till now lighttpd was the > odd one out among the pkg daemons on my system. By that, I don't mean > that's the `wrong' one.) I think it's the odd one because it's one of the few that's been updated to the best current practices. If you look at the log for the change which introduced that new pattern you'll see a good clue as to the reasoning: revision 1.4 date: 2024-01-21 01:33:35 -0800; author: triaxx; state: Exp; lines: +8 -2; commitid: 9tNiAEGjL2cOyiVE; lighttpd: Fix lighttpd.sh to work in unprivileged I've not yet seen any documentation as to how one might be expected to set up an unprivileged pkg install with full rc.d support that doesn't depend on the system /etc/rc, but it seems fairly obvious that with the pattern(s) shown in lighthttpd.sh it could be done. Perhaps there's already a package to do it! :-) Note the new pattern of prefixing the sourcing of rc.subr with the new variable $_rc_subr_loaded doesn't seem to be documented in rc.subr(8) and rc(8) yet either. -- Greg A. Woods <gwoods%acm.org@localhost> Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost> Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
Attachment:
pgp45st5pYeCt.pgp
Description: OpenPGP Digital Signature