Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jan 2004 07:50:15 -0800 (PST)
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: conf/56736: [PATCH] rcNG: enable packages to participate in rcorder(8)
Message-ID:  <200401231550.i0NFoF5K016889@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/56736; it has been noted by GNATS.

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: conf/56736: [PATCH] rcNG: enable packages to participate in rcorder(8)
Date: Fri, 23 Jan 2004 16:48:34 +0100

 I essentially reimplemented my 5.1 patch for 5.2, ending with
 a slightly less elegant solution. Also take into account that
 rcorder(8) accepts KEYWORDS:
 
 --- src/etc/rc.orig	Fri May  2 07:27:33 2003
 +++ src/etc/rc	Fri Jan 23 16:24:47 2004
 @@ -53,7 +53,7 @@
  . /etc/rc.subr
  
  # Note: the system configuration files are loaded as part of
 -# the RCNG system (rc.d/rccond).  Do not load them here as it may
 +# the RCNG system (rc.d/rcconf.sh).  Do not load them here as it may
  # interfere with diskless booting.
  #
  if [ "$1" = autoboot ]; then
 @@ -69,6 +69,35 @@
  files=`rcorder -k ${os} -s nostart /etc/rc.d/* 2>/dev/null`
  
  for _rc_elem in ${files}; do
 +	if [ ${_rc_elem} = "/etc/rc.d/PORTS" ]; then
 +		break
 +	fi
 +	run_rc_script ${_rc_elem} ${_boot}
 +done
 +
 +# system configuration is loaded, reevalute rcorder
 +case ${local_startup} in
 +[Nn][Oo] | '')
 +	;;
 +*)
 +	_rc_startup="/etc/rc.d/*"
 +	for dir in ${local_startup}; do
 +		if [ -d "${dir}" ]; then
 +			_rc_startup="${_rc_startup} ${dir}/*"
 +		fi
 +	done
 +	files=`rcorder -k ${os} -s nostart ${_rc_startup} 2>/dev/null`
 +esac
 +
 +_rc_done=true
 +for _rc_elem in ${files}; do
 +	if ${_rc_done}; then
 +		if [ ${_rc_elem} = "/etc/rc.d/PORTS" ]; then
 +			_rc_done=false
 +		else
 +			continue
 +		fi
 +	fi
  	run_rc_script ${_rc_elem} ${_boot}
  done
  
 --- src/etc/rc.shutdown.orig	Tue Jul  8 04:52:14 2003
 +++ src/etc/rc.shutdown	Fri Jan 23 16:29:59 2004
 @@ -82,7 +82,19 @@
  # XXX - rcorder(8) with multiple -k switches works as a logical OR,
  #       so, we can't do this: rcorder -k shutdown -k FreeBSD.
  #
 -files=`eval grep -l \'^# KEYWORD:.*FreeBSD\' \`rcorder -k shutdown /etc/rc.d/* 2>/dev/null\``
 +_rc_startup="/etc/rc.d/*"
 +case ${local_startup} in
 +[Nn][Oo] | '')
 +        ;;
 +*)
 +	for dir in ${local_startup}; do
 +		if [ -d "${dir}" ]; then
 +			_rc_startup="${_rc_startup} ${dir}/*"
 +		fi
 +	done
 +	;;
 +esac
 +files=`eval grep -El \'^# KEYWORDS?:.*FreeBSD\' \`rcorder -k shutdown ${_rc_startup} 2>/dev/null\``
  
  for _rc_elem in `reverse_list $files`; do
  	debug "run_rc_script $_rc_elem stop"
 --- src/etc/rc.d/localpkg.orig	Wed Aug  6 02:35:13 2003
 +++ src/etc/rc.d/localpkg	Fri Jan 23 16:22:58 2004
 @@ -29,7 +29,7 @@
  		fi
  		for dir in ${local_startup}; do
  			if [ -d "${dir}" ]; then
 -				for script in ${dir}/*.sh; do
 +				for script in `grep -EL '^# KEYWORDS?:' ${dir}/*.sh 2>/dev/null`; do
  					slist="${slist}${script_name_sep}${script}"
  				done
  			fi
 @@ -66,7 +66,7 @@
  		fi
  		for dir in ${local_startup}; do
  			if [ -d "${dir}" ]; then
 -				for script in ${dir}/*.sh; do
 +				for script in `grep -EL '^# KEYWORDS?:' ${dir}/*.sh 2>/dev/null`; do
  					slist="${slist}${script_name_sep}${script}"
  				done
  			fi
 --- src/etc/rc.d/PORTS.orig	Fri Jan 23 15:11:00 2004
 +++ src/etc/rc.d/PORTS	Fri Jan 23 13:09:50 2004
 @@ -0,0 +1,11 @@
 +#!/bin/sh
 +#
 +# $FreeBSD$
 +#
 +
 +# PROVIDE: PORTS
 +# REQUIRE: diskless mountcritlocal
 +# BEFORE: addswap random
 +# KEYWORD: FreeBSD
 +
 +#	This is a dummy dependency to include ports into rcorder(8)
 



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