From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 23 07:50:17 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E30C816A4CE for ; Fri, 23 Jan 2004 07:50:16 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D8EF43D2D for ; Fri, 23 Jan 2004 07:50:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0NFoFFR016890 for ; Fri, 23 Jan 2004 07:50:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0NFoF5K016889; Fri, 23 Jan 2004 07:50:15 -0800 (PST) (envelope-from gnats) Date: Fri, 23 Jan 2004 07:50:15 -0800 (PST) Message-Id: <200401231550.i0NFoF5K016889@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Oliver Eikemeier Subject: Re: conf/56736: [PATCH] rcNG: enable packages to participate in rcorder(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Oliver Eikemeier List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2004 15:50:17 -0000 The following reply was made to PR conf/56736; it has been noted by GNATS. From: Oliver Eikemeier 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)