From owner-freebsd-ports@FreeBSD.ORG Mon Jul 7 09:17:52 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 814D737B401; Mon, 7 Jul 2003 09:17:52 -0700 (PDT) Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE03443FB1; Mon, 7 Jul 2003 09:17:50 -0700 (PDT) (envelope-from hetzels@westbend.net) Received: from ADMIN00 (admin00.westbend.net [216.47.253.17]) by mail.westbend.net (8.12.9/8.12.9) with SMTP id h67GHlHZ054877; Mon, 7 Jul 2003 11:17:47 -0500 (CDT) (envelope-from hetzels@westbend.net) Message-ID: <013701c344a3$fc539540$11fd2fd8@westbend.net> From: "Scot W. Hetzel" To: Date: Mon, 7 Jul 2003 11:22:38 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Status: No, hits=1.0 required=8.0 tests=SPAM_PHRASE_00_01,USER_AGENT_OE version=2.43 X-Spam-Level: * Subject: rc.subr for older FreeBSD systems X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2003 16:17:53 -0000 For a while, I had been looking at converting my ports scripts to rcNG and to allow them to run on older rcOLD systems. I started using the NetBSD approach of including both rcNG and rcOLD in the same script (see security/cyrus-sasl and www/apache13-fp). While this works, it requires both the port maintainer and port commiter to ensure that the rc.d script functions correctly on both rcNG and rcOLD systems. I propose that we get rid of the rcOLD syntax in the rc.d scripts, so that by the time FreeBSD 4.9 and 5.2 Releases, our rc.d scripts are completely converted to rcNG. In order for this to happen, we need to support older releases that don't have rc.subr. This can be accomplished by creating a port for rc.subr. And then setting a RUN_DEPENDS on the rc.subr port for these older systems. This port for rc_subr has been created and tested on FreeBSD 4.8-STABLE (see PR 54116) using fully converted rcNG scripts for the security/cyrus-sasl port. http://www.freebsd.org/cgi/query-pr.cgi?pr=54116 To use the rc_subr port we need to patch bsd.port.mk, so that we can set USE_RC_SUBR variable in the ports Makefile which have been converted to rcNG. This is used to determine if the rc_subr port is needed and where rc.subr is located (/etc or LOCALBASE/etc). Then all a port maintainer needs to do is to convert their scripts to rcNG syntax: #!/bin/sh # # $FreeBSD: ports/security/cyrus-sasl/files/saslauthd.sh,v 1.3 2003/05/09 12:41:21 arved Exp $ # # PROVIDE: saslauthd1 # REQUIRE: DAEMON # BEFORE: mail imap # KEYWORD: FreeBSD shutdown # # NOTE for FreeBSD 5.0+: # If you want this script to start with the base rc scripts # move saslauthd1.sh to /etc/rc.d/saslauthd1 prefix=%%PREFIX%% # Define these saslauthd1_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/saslauthd1 # # DO NOT CHANGE THESE DEFAULT VALUES HERE # saslauthd1_enable="%%ENABLE_SASLAUTHD%%" # Enable saslauthd #saslauthd1_program="${prefix}/sbin/saslauthd1" # Location of saslauthd1 saslauthd1_flags="-a pam" # Flags to saslauthd program . %%RC_SUBR%% name="saslauthd1" rcvar=`set_rcvar` command="${prefix}/sbin/${name}" pidfile="/var/state/${name}/mux.pid" load_rc_config $name run_rc_command "$1" Then the port maintainers will need to change their ports Makefile to set USE_RC_SUBR, and to substitute the correct location of rc.subr in their rc.d scripts.: USE_RC_SUBR= YES : RC_SCRIPTS_SUB= PREFIX=${PREFIX} \ RC_SUBR=${RC_SUBR} \ PWCHECK=${PWCHECK} \ ENABLE_PWCHECK=${ENABLE_PWCHECK} \ ENABLE_SASLAUTHD=${ENABLE_SASLAUTHD} \ MYSQL_REQ=${MYSQL_REQ} : post-install: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/pwcheck.sh > ${PREFIX}/etc/rc.d/cyrus_pwcheck.sh @${CHMOD} 755 ${PREFIX}/etc/rc.d/cyrus_pwcheck.sh Could a portmgr have a look at this port. Thanks, Scot W. Hetzel