Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Mar 2006 17:41:53 +0200
From:      Dirk Engling <erdgeist@erdgeist.org>
To:        freebsd-rc@freebsd.org
Subject:   Extend the rc interface for configuration
Message-ID:  <4426B641.7030203@erdgeist.org>

next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear rc-hackers,

in my understanding the rc.d interface is a generic abstraction of
common actions you want to perform on server software.

When administrating lots of servers of different type I stumbled accross
many configuration actions that were similar, for example
adding/removing virtual hosts and users for my mail/ web/ ftp/ name/
jabber-server, configuring ports, logfiles, ssl-ports + certs/ keys etc.

Some servers bring their own configuration tools (~vpopmail/bin/*,
/etc/tinydns/root), in that case rc.d-scripts could just be a wrapper
for the config interface.

I wrote simple scripts that copy and modify apache vhost config files
(www_adddomain). Scripts like those would implement the new interface
for servers not bringing config tools.

The interface is simple enough to cover most of everyday uses and
defining it does no harm, since noone is forced to implement it, on the
other hand it would be a lot easier to find the appropriate tools, even,
if their interface doesn't (yet) match the one I thought of.

rc.subr could provide some helper functions to replace variables in
value=expr stlye config files. So providing a

conf_file=/usr/local/etc/fooserver.conf
conf_ip_variable=listen-address
conf_port_variable=listen-port
conf_logfile_variable=log

could be enough to implement the config interface for a simple server, where

/usr/local/etc/rc.d/fooserver.sh conf ip 127.0.0.1 port 2342 log
/var/log/fooserver.log autostart

would setup our server appropriately and a keyword like autostart could
even add the rcvar fooserver_enable="YES" to /etc/rc.conf.

I know, this is not totally thought through but before investing time in
implementing a prototype I'd like to hear some thoughts from you, having
spent more time than me in rc scripts.

Regards

  erdgeist
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (Darwin)

iD8DBQFEJrZAImmQdUyYEgkRAoCSAJ4p5amTuNbMuhUt4k2qcsw+77kcfACfeASm
WXLx2o7KUowLYSnkmOoETz0=
=/DmV
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4426B641.7030203>