From owner-freebsd-bugs@FreeBSD.ORG Sun Dec 14 21:50:28 2003 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 9006216A4CF for ; Sun, 14 Dec 2003 21:50:28 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 824D043D39 for ; Sun, 14 Dec 2003 21:50:24 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) hBF5oOFR010568 for ; Sun, 14 Dec 2003 21:50:24 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id hBF5oOJ7010567; Sun, 14 Dec 2003 21:50:24 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 14 Dec 2003 21:50:24 -0800 (PST) Resent-Message-Id: <200312150550.hBF5oOJ7010567@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joel Ray Holveck Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2151616A4CE for ; Sun, 14 Dec 2003 21:46:58 -0800 (PST) Received: from thor.piquan.org (adsl-66-125-235-59.dsl.sntc01.pacbell.net [66.125.235.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBCDA43D1F for ; Sun, 14 Dec 2003 21:46:55 -0800 (PST) (envelope-from joelh@thor.piquan.org) Received: from thor.piquan.org (joelh@localhost [127.0.0.1]) by thor.piquan.org (8.12.10/8.12.10) with ESMTP id hBF5ktb0013354 for ; Sun, 14 Dec 2003 21:46:55 -0800 (PST) (envelope-from joelh@thor.piquan.org) Received: (from joelh@localhost) by thor.piquan.org (8.12.10/8.12.10/Submit) id hBF5ktKI013353; Sun, 14 Dec 2003 21:46:55 -0800 (PST) (envelope-from joelh) Message-Id: <200312150546.hBF5ktKI013353@thor.piquan.org> Date: Sun, 14 Dec 2003 21:46:55 -0800 (PST) From: Joel Ray Holveck To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/60246: [PATCH] mergemaster does not warn for obsolete rc.d files X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2003 05:50:28 -0000 >Number: 60246 >Category: bin >Synopsis: [PATCH] mergemaster does not warn for obsolete rc.d files >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 14 21:50:24 PST 2003 >Closed-Date: >Last-Modified: >Originator: Joel Ray Holveck >Release: FreeBSD 5.2-RC i386 >Organization: >Environment: System: FreeBSD thor.piquan.org 5.2-RC FreeBSD 5.2-RC #21: Sun Dec 14 19:40:38 PST 2003 joelh@thor.piquan.org:/usr/local/src/freebsd/obj/usr/local/src/freebsd/src/sys/THOR i386 >Description: >From UPDATING: 20030829: The following rc.d scripts have been removed and should be deleted from your installation: atm2.sh atm3.sh devdb localdaemons network1 network2 network3. Depending on when you last updated world and used mergemaster(8) you may or may not have problems during the rc boot sequence. The simplest solution is an 'rm -rf /etc/rc.d/*' and then 'mergemaster -i'. The atm2.sh atm3.sh and devdb scripts were removed some time ago, so depending on when you installed -CURRENT these scripts may or may not exist on your system. These scripts can certainly cause boot problems. It would be nice if mergemaster warned the user if these scripts existed, and offered to move them. >How-To-Repeat: >From a 5.1 system, upgrade to 5.2-RC, but don't delete anything from rc.d. On your next boot, look for failures. If you have them installed, error messages will get logged into /var/log/messages from dhcpd, samba, postgres, and probably others. >Fix: Apply the following patch to src/usr.sbin/mergemaster/mergemaster.sh: --- mergemaster.sh.~1~ Sun Dec 14 21:33:45 2003 +++ mergemaster.sh Sun Dec 14 21:39:59 2003 @@ -650,6 +650,71 @@ esac esac +for file in atm2.sh atm3.sh devdb localdaemons network1 network2 network3; do + if [ -f "${DESTDIR}/etc/rc.d/${file}" ]; then + OLD_RC_D_PRESENT=1 + break + fi +done + +case "${OLD_RC_D_PRESENT}" in +1) + echo '' + echo " *** There are old rc.d scripts in ${DESTDIR}/etc/rc.d." + echo '' + echo ' Depending on when you last updated world and used mergemaster' + echo ' they may or may not cause problems during the rc boot sequence.' + echo ' These files can and probably should be removed.' + echo '' + + case "${AUTO_RUN}" in + '') + echo -n 'Move these files to /var/tmp/mergemaster/old_rc_d? [yes] ' + read MOVE_OLD_RC_D + + case "${MOVE_OLD_RC_D}" in + [nN]*) ;; + *) + mkdir -p /var/tmp/mergemaster/old_rc_d + for file in atm2.sh atm3.sh devdb localdaemons network1 network2 \ + network3; do + if [ -f "${DESTDIR}/etc/rc.d/${file}" ]; then + mv ${DESTDIR}/etc/rc.d/${file} /var/tmp/mergemaster/old_rc_d/ + fi + done + echo ' The files have been moved to /var/tmp/mergemaster/old_rc_d/' + press_to_continue + ;; + esac + ;; + *) + # auto_run is a bit anomolous for this case. We don't terribly + # want to risk the next boot being messed up, but we don't really + # want to modify /etc. (The run may not even be for an immediate + # installation!) + # + # We create dummy files in our temp directory. When the operator + # manually reviews the files, then this should clue him that + # attention is needed for these files. If the files are copied + # into /etc later, bulk-style, then the files won't hurt the boot + # process. (As a precaution, we don't make them executable, so + # they won't even be run.) The content is to make them show up in + # the summary at the end, which doesn't list 0-length files. + for file in atm2.sh atm3.sh devdb localdaemons network1 network2 \ + network3; do + if [ -f "${DESTDIR}/etc/rc.d/${file}" ]; then + echo " *** /etc/rc.d/${file} will remain for your consideration" + cat > ${TEMPROOT}/etc/rc.d/${file} <Release-Note: >Audit-Trail: >Unformatted: