FreeBSD 5.x introduced the rcNG system brought in from NetBSD. RcNG places common routines into /etc/rc.subr for all startup/ shutdown scripts to use. This greatly simplifies the writing of startup/shutdown scripts. RcNG also provides scripts with a common set of arguments (start, stop, restart, rcvar, status, poll, ... ). Currently, the ports startup/shutdown scripts do not support rcNG, due to older versions of FreeBSD do not have /etc/rc.subr. I had a look at how NetBSD solved this problem, and thier scripts are a combination of rcOLD and rcNG. These scripts determine which system they are running on by checking for the existence of /etc/rc.subr. I had been converting my ports (see security/cyrus-sasl and www/apache13-fp) to use the same approach as NetBSD. While this works, it over complicates the startup/shutdown script by needing to check for which rc system the script is running on. Also the port maintainer would need to check their script to ensure it runs on both rcOLD and rcNG systems. This port aims to solve this problem by getting rid of the rcOLD completely, and only provide rcNG in the port statup/shutdown scripts. As port's rc scripts are converted to rcNG, the port maintainer must define USE_RC_SUBR in its Makefile. This will cause the port to have a run dependency on sysutils/rc_subr on systems where /etc/rc.subr doesn't exist. The port maintainer will also need to substitute RC_SUBR with the value of ${RC_SUBR} in their script. Attached is the shar archive for sysutils/rc_subr port. I have also included the patch for bsd.port.mk (rc_subr/patch-bsd.port.mk). I have also included a patch for security/cyrus-sasl as an example port whose startup/shutdown scripts has been fully converted to rcNG (rc_subr/patch-cyrus-sasl). With this patch applied, I was able to start, stop, and issue the status commands for the startup/shutdown scripts on FreeBSD 4.8 and 5.1. NOTE: 1. I placed the port in sysutils, if that is incorrect then change the CATAGORIES variable, and bsd.port.mk to the correct value. 2. Currently, the distfile for the port is being hosted at ftp.westbend.net, I would like to request that this distfile be hosted at MASTER_SITE_LOCAL. 3. After portmgr approves the bsd.port.mk patch, and rc_subr is commited, please commit the patch to security/cyrus-sasl.
A few more ports have been converted to RC_NG, see PR 54352. Scot W. Hetzel
State Changed From-To: open->analyzed I asked portmgr@ about this patch.
Okay, sysutils/rc_subr port is committed. I'm waiting portmgr@ committing bsd.port.mk part. One of portmgr@ said we may require version identification scheme of rc.subr script like "version" argument.
This patch has been added to the 4-exp tree on bento for testing. I've included both the bsd.port.mk and cyrus-sasl patches. regards, -- wca
Please use hetzelsw@westbend.net, as I received 8000 virus and virus warning messages in my inbox this morning.
State Changed From-To: analyzed->closed Committed, thanks!