From owner-freebsd-rc@FreeBSD.ORG Fri Aug 27 15:24:40 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C89D216A4CF for ; Fri, 27 Aug 2004 15:24:40 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F6E743D58 for ; Fri, 27 Aug 2004 15:24:40 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: by mproxy.gmail.com with SMTP id 77so224361rnl for ; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Received: by 10.38.15.69 with SMTP id 69mr2485511rno; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Received: by 10.38.75.25 with HTTP; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Message-ID: <790a9fff0408270824750baf89@mail.gmail.com> Date: Fri, 27 Aug 2004 10:24:39 -0500 From: Scot Hetzel To: dougb@freebsd.org In-Reply-To: <790a9fff04081715382b449355@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_13_21427464.1093620279340" References: <20040817223335.F2E3B5D04@ptavv.es.net> <790a9fff04081715382b449355@mail.gmail.com> cc: freebsd-rc@freebsd.org cc: current@freebsd.org Subject: Patch for mergemaster [was Re: RFC: Alternate patch to have true new-style rc.d scripts in ports (without touching localpkg)] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Scot Hetzel List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 15:24:41 -0000 ------=_Part_13_21427464.1093620279340 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 17 Aug 2004 17:38:03 -0500, Scot Hetzel wrote: > On Tue, 17 Aug 2004 15:33:35 -0700, Kevin Oberman wrote: > > > Date: Tue, 17 Aug 2004 17:24:27 -0500 > > > From: Scot Hetzel > > > > > > > > > > On Tue, 17 Aug 2004 14:58:14 -0700, Kevin Oberman wrote: > > > > > It is best to leave the moving of these scripts up to the individual > > > > > administrator. > > > > > > > > Only if mergemaster is fixed! > > > > > > > This could be fixed by adding: > > > > > > # KEYWORD: FreeBSD PORT > > > > > > to each startup script. Then making mergemaster ignore any script > > > that has PORT in the KEYWORD line. > > > > Yes, this would work, although I would prefer: > > # KEYWORD: FreeBSD USER > > since some systems might want to add scripts to rc.local that are not > > from ports. > > > Another option is to use: > # KEYWORD: FreeBSD SYSTEM > > for system startup scripts and only have mergemaster look at scripts > with SYSTEM as KEYWORD. > Several individuals expressed their concern with mergemaster deleting scripts from /etc/rc.d. The main concern is that an administator could create their own scripts and place them into /etc/rc.d, then either they forget about their script, or another admin is updating and they accidently delete the script during the mergemaster process. Attached is a patch to mergemaster that checks the script files for "$FreeBSD: src" during the STALE_RC_FILES check. If a script has such a header, it is assumed to be a stale rc file. The old behavior of checking all scripts is still available when the -s flag is specified to mergemaster. I have EXTRA_RC_FILES, but it currently doesn't do anything with them. Scot Index: mergemaster.sh =================================================================== RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v retrieving revision 1.51 diff -u -r1.51 mergemaster.sh --- mergemaster.sh 7 Mar 2004 10:10:19 -0000 1.51 +++ mergemaster.sh 26 Aug 2004 08:54:54 -0000 @@ -790,7 +790,18 @@ cd "${DESTDIR}/etc/rc.d" && for file in *; do if [ ! -e "${TEMPROOT}/etc/rc.d/${file}" ]; then - STALE_RC_FILES="${STALE_RC_FILES} ${file}" + case "${STRICT}" in + [Yy][Ee][Ss]) + STALE_RC_FILES="${STALE_RC_FILES} ${file}" + ;; + '' | [Nn][Oo]) + if grep -c "[$]${CVS_ID_TAG}: src" ${file} ; then + STALE_RC_FILES="${STALE_RC_FILES} ${file}" + else + EXTRA_RC_FILES="${EXTRA_RC_FILES} ${file}" + fi + ;; + esac fi done case "${STALE_RC_FILES}" in ------=_Part_13_21427464.1093620279340 Content-Type: application/octet-stream; name="mergemaster.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="mergemaster.diff" VG86IERvdWdCQEZyZWVCU0Qub3JnLCBGcmVlQlNELUN1cnJlbnRARnJlZUJTRC5vcmcKU3ViamVj dDoKCkluZGV4OiBtZXJnZW1hc3Rlci5zaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvaG9tZS9uY3Zz L3NyYy91c3Iuc2Jpbi9tZXJnZW1hc3Rlci9tZXJnZW1hc3Rlci5zaCx2CnJldHJpZXZpbmcgcmV2 aXNpb24gMS41MQpkaWZmIC11IC1yMS41MSBtZXJnZW1hc3Rlci5zaAotLS0gbWVyZ2VtYXN0ZXIu c2gJNyBNYXIgMjAwNCAxMDoxMDoxOSAtMDAwMAkxLjUxCisrKyBtZXJnZW1hc3Rlci5zaAkyNiBB dWcgMjAwNCAwODo1NDo1NCAtMDAwMApAQCAtNzkwLDcgKzc5MCwxOCBAQAogICBjZCAiJHtERVNU RElSfS9ldGMvcmMuZCIgJiYKICAgZm9yIGZpbGUgaW4gKjsgZG8KICAgICBpZiBbICEgLWUgIiR7 VEVNUFJPT1R9L2V0Yy9yYy5kLyR7ZmlsZX0iIF07IHRoZW4KLSAgICAgIFNUQUxFX1JDX0ZJTEVT PSIke1NUQUxFX1JDX0ZJTEVTfSAke2ZpbGV9IgorICAgICAgY2FzZSAiJHtTVFJJQ1R9IiBpbgor ICAgICAgW1l5XVtFZV1bU3NdKQorICAgICAgICBTVEFMRV9SQ19GSUxFUz0iJHtTVEFMRV9SQ19G SUxFU30gJHtmaWxlfSIKKyAgICAgICAgOzsKKyAgICAgICcnIHwgW05uXVtPb10pCisgICAgICAg IGlmIGdyZXAgLWMgIlskXSR7Q1ZTX0lEX1RBR306IHNyYyIgJHtmaWxlfSA7IHRoZW4KKyAgICAg ICAgICBTVEFMRV9SQ19GSUxFUz0iJHtTVEFMRV9SQ19GSUxFU30gJHtmaWxlfSIKKyAgICAgICAg ZWxzZQorICAgICAgICAgIEVYVFJBX1JDX0ZJTEVTPSIke0VYVFJBX1JDX0ZJTEVTfSAke2ZpbGV9 IgorICAgICAgICBmaQorICAgICAgICA7OworICAgICAgZXNhYwogICAgIGZpCiAgIGRvbmUKICAg Y2FzZSAiJHtTVEFMRV9SQ19GSUxFU30iIGluCg== ------=_Part_13_21427464.1093620279340-- From owner-freebsd-rc@FreeBSD.ORG Fri Aug 27 16:08:40 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6212716A4CE; Fri, 27 Aug 2004 16:08:40 +0000 (GMT) Received: from fillmore.dyndns.org (port-212-202-50-15.dynamic.qsc.de [212.202.50.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2541D43D5C; Fri, 27 Aug 2004 16:08:40 +0000 (GMT) (envelope-from eikemeier@fillmore-labs.com) Received: from dhcp-13.local ([172.16.0.13]) by fillmore.dyndns.org with esmtps (TLSv1:DES-CBC3-SHA:168) (Exim 4.42 (FreeBSD)) id 1C0jHJ-000FeA-78; Fri, 27 Aug 2004 18:08:39 +0200 Date: Fri, 27 Aug 2004 18:08:51 +0200 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) To: Scot Hetzel From: Oliver Eikemeier In-Reply-To: <790a9fff0408270824750baf89@mail.gmail.com> Message-Id: <62D80202-F843-11D8-AC6A-00039312D914@fillmore-labs.com> Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: freebsd-rc@freebsd.org cc: current@freebsd.org Subject: Re: Patch for mergemaster [was Re: RFC: Alternate patch to have true new-style rc.d scripts in ports (without touching localpkg)] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 16:08:40 -0000 Scot Hetzel wrote: > Several individuals expressed their concern with mergemaster deleting > scripts from /etc/rc.d. The main concern is that an administator > could create their own scripts and place them into /etc/rc.d, then > either they forget about their script, or another admin is updating > and they accidently delete the script during the mergemaster process. > > Attached is a patch to mergemaster that checks the script files for > "$FreeBSD: src" during the STALE_RC_FILES check. If a script has such > a header, it is assumed to be a stale rc file. The old behavior of > checking all scripts is still available when the -s flag is specified > to mergemaster. An alternate approach is in PR 64476: But probably the "$FreeBSD: src" test is more useful, I'm not sure. Anyway, you could post this as a follow-up, so that both approaches could be compared. -Oliver From owner-freebsd-rc@FreeBSD.ORG Fri Aug 27 16:20:10 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C544D16A4D0 for ; Fri, 27 Aug 2004 16:20:10 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 521FD43D2F for ; Fri, 27 Aug 2004 16:20:10 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: by mproxy.gmail.com with SMTP id 77so227003rnl for ; Fri, 27 Aug 2004 09:20:06 -0700 (PDT) Received: by 10.38.83.11 with SMTP id g11mr2099814rnb; Fri, 27 Aug 2004 09:20:06 -0700 (PDT) Received: by 10.38.75.25 with HTTP; Fri, 27 Aug 2004 09:20:06 -0700 (PDT) Message-ID: <790a9fff0408270920a9e694@mail.gmail.com> Date: Fri, 27 Aug 2004 11:20:06 -0500 From: Scot Hetzel To: Oliver Eikemeier In-Reply-To: <62D80202-F843-11D8-AC6A-00039312D914@fillmore-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <62D80202-F843-11D8-AC6A-00039312D914@fillmore-labs.com> cc: freebsd-rc@freebsd.org cc: current@freebsd.org Subject: Re: Patch for mergemaster [was Re: RFC: Alternate patch to have true new-style rc.d scripts in ports (without touching localpkg)] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Scot Hetzel List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 16:20:10 -0000 On Fri, 27 Aug 2004 18:08:51 +0200, Oliver Eikemeier wrote: > Scot Hetzel wrote: > > > Attached is a patch to mergemaster that checks the script files for > > "$FreeBSD: src" during the STALE_RC_FILES check. If a script has such > > a header, it is assumed to be a stale rc file. The old behavior of > > checking all scripts is still available when the -s flag is specified > > to mergemaster. > > An alternate approach is in PR 64476: > > > But probably the "$FreeBSD: src" test is more useful, I'm not sure. > Anyway, you could post this as a follow-up, so that both approaches > could be compared. > OK, sent patch as follow-up to this PR. Scot