Bug 54116 - New port: sysutils/rc_subr (rcNG support for port scripts)
Summary: New port: sysutils/rc_subr (rcNG support for port scripts)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-04 23:40 UTC by Scot W. Hetzel
Modified: 2003-08-27 05:43 UTC (History)
0 users

See Also:


Attachments
file.shar (9.57 KB, text/plain)
2003-07-04 23:40 UTC, Scot W. Hetzel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scot W. Hetzel 2003-07-04 23:40:16 UTC
	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.
Comment 1 Scot W. Hetzel 2003-07-12 01:32:55 UTC
A few more ports have been converted to RC_NG, see PR 54352.

Scot W. Hetzel
Comment 2 Jun Kuriyama freebsd_committer freebsd_triage 2003-08-17 10:30:01 UTC
State Changed
From-To: open->analyzed

I asked portmgr@ about this patch.
Comment 3 Jun Kuriyama freebsd_committer freebsd_triage 2003-08-17 14:41:04 UTC
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.
Comment 4 Will Andrews 2003-08-17 21:00:39 UTC
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
Comment 5 Scot W. Hetzel 2003-08-19 22:19:43 UTC
Please use hetzelsw@westbend.net, as I received 8000 virus and virus warning
messages in my inbox this morning.
Comment 6 Joe Marcus Clarke freebsd_committer freebsd_triage 2003-08-27 05:43:01 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!