From owner-freebsd-rc@FreeBSD.ORG Sun Mar 26 15:40:54 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C100616A401 for ; Sun, 26 Mar 2006 15:40:54 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [80.237.196.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id F24B843D48 for ; Sun, 26 Mar 2006 15:40:53 +0000 (GMT) (envelope-from erdgeist@erdgeist.org) Received: (qmail 28065 invoked by uid 0); 26 Mar 2006 15:40:30 -0000 Received: from e178042194.adsl.alicedsl.de (HELO ?10.1.1.106?) (erdgeist@erdgeist.org@85.178.42.194) by elektropost.org with AES256-SHA encrypted SMTP; 26 Mar 2006 15:40:30 -0000 Message-ID: <4426B641.7030203@erdgeist.org> Date: Sun, 26 Mar 2006 17:41:53 +0200 From: Dirk Engling User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: freebsd-rc@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Extend the rc interface for configuration X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2006 15:40:54 -0000 -----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-----