Date: Sun, 10 Feb 2002 12:52:14 -0800
From: Sean Chittenden <sean@chittenden.org>
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>
next in thread | raw e-mail | index | archive | help
[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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020210125214.B43813>
