Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 2003 21:46:55 -0800 (PST)
From:      Joel Ray Holveck <joelh@piquan.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:    bin/60246: [PATCH] mergemaster does not warn for obsolete rc.d files
Message-ID:  <200312150546.hBF5ktKI013353@thor.piquan.org>
Resent-Message-ID: <200312150550.hBF5oOJ7010567@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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} <<EOF
+#! /bin/sh
+# This file is obsolete and should be deleted.  See UPDATING for details.
+exit 0
+EOF
+      fi
+    done
+  ;;
+  esac
+esac
+
 # Use the umask/mode information to install the files
 # Create directories as needed
 #
>Release-Note:
>Audit-Trail:
>Unformatted:



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