From owner-freebsd-arch Sun Feb 10 12:52:18 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.tgd.net (mail.tgd.net [209.81.25.10]) by hub.freebsd.org (Postfix) with ESMTP id DE4EA37B400 for ; Sun, 10 Feb 2002 12:52:14 -0800 (PST) Received: by mail.tgd.net (Postfix, from userid 1001) id B7BC420F0A; Sun, 10 Feb 2002 12:52:14 -0800 (PST) Date: Sun, 10 Feb 2002 12:52:14 -0800 From: Sean Chittenden To: freebsd-arch@freebsd.org Subject: Site wide daemon startup policy for ports ala ${PREFIX}/etc/(rc.conf|defaults/)... Message-ID: <20020210125214.B43813@ninja1.internal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-PGP-Key: 0x1EDDFAAD X-PGP-Fingerprint: C665 A17F 9A56 286C 5CFB 1DEA 9F4F 5CEF 1EDD FAAD X-Web-Homepage: http://sean.chittenden.org/ Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [Please direct to -hackers or -ports if more appropriate] Hypothetical situation: let's say that with SNMP I like to use syslog, which requires the -s flag to snmpd. No biggie, I can hack etc/rc.d/snmpd.sh. With many machines, however, this is a tad tiresome, esp if I don't have SNMP installed on every box. What I'd like to do is be able to use a system similar to what's in /etc with its rc.conf and defaults/rc.conf that way I could specify something akin to: snmpd_flags="-s" Just like one does with /etc/rc.conf. Quick summary (bad pseudo-code): Defaults = eval `cat ${PREFIX}/etc/defaults/*.conf` Host specific = eval `cat ${PREFIX}/etc/rc.conf` Startup script = ${PREFIX}/etc/rc.d/snmpd.sh Example implementation: A port that has configuration options would install its default parameters in ${PREFIX}/etc/defaults in a .conf file, using SNMP as an example, in ${PREFIX}/etc/defaults/snmpd.conf). When the host administrator wants to tweak a setting, such as adding the -s flag to snmpd, they tweak the settings in ${PREFIX}/etc/rc.conf. Now, when the system boots or the administrator kicks the port via ${PREFIX}/etc/snmpd.sh, it'd source a global "integrate with FreeBSD's rc/ports startup foo" function which sets the default and host specific parameters that way in snmpd.sh, you can see a nifty little line that looks something like: ${PREFIX}/sbin/snmpd ${snmpd_flags} This'd apply to other ports/apps and would require their startup scripts to be adjusted, but seems like a nice way of centralizing a lot of this configuration goo (mailman's default hostname comes to mind as another quick and easy win, same with postfix UIDs). A follow up win would also come in documenting application specific CLI tunables though ${PREFIX}/etc/defaults/${app_name}.conf. This could be a huge win for administrators. Sources of Discussion: The one bit of this that I'm a little torn about is the situation for NFS mounting /usr or /usr/local. That said, ${PREFIX}/etc/rc.conf could also be /etc/rc.conf because /etc/rc.conf shouldn't be NFS mounted. What I think would be the ideal situation would be to sourcing all three defaults in this order: defaults, ${PREFIX}/etc/rc.conf, then /etc/rc.conf. Thoughts? -sc -- Sean Chittenden To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message