From owner-cvs-all Mon Mar 11 18:22:19 2002 Delivered-To: cvs-all@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 0357537B402; Mon, 11 Mar 2002 18:22:13 -0800 (PST) Received: from blossom.cjclark.org ([12.234.91.48]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020312022207.UDVS2951.rwcrmhc53.attbi.com@blossom.cjclark.org>; Tue, 12 Mar 2002 02:22:07 +0000 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.6) id g2C2M0J31142; Mon, 11 Mar 2002 18:22:00 -0800 (PST) (envelope-from cjc) Date: Mon, 11 Mar 2002 18:22:00 -0800 From: "Crist J. Clark" To: Dag-Erling Smorgrav Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc rc src/share/man/man5 rc.conf.5 Message-ID: <20020311182200.D29705@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200203110847.g2B8l4714026@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Mon, Mar 11, 2002 at 10:22:17PM +0100 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Mar 11, 2002 at 10:22:17PM +0100, Dag-Erling Smorgrav wrote: > "Crist J. Clark" writes: > > At the same time, allow the administrator to have dumpdev enabled > > while dumpdir (savecore(8)) is disabled and document how to do it. > > Speaking of dumpdev, 'dumpon ${dumpdev}' should be one of the very > very first things we do in /etc/rc, before even fsck - it's not > uncommon for kernel bugs to cause panics during the boot process, and > it's a PITA not to have a dump device configured in time. Makes sense. How about doing it first thing after we load the rc.conf files? In addition, take out the checks on the $dumpdev. dumpon(8) behaves well if given a non-existent filename. It gives a nice error message which is better rather than the current silent failure. Likewise, we can take out the remaining safety net for the savecore(8) run; it doesn't need hand-holding. Let misconfigured setups produce error messages. Index: etc/rc =================================================================== RCS file: /export/freebsd/ncvs/src/etc/rc,v retrieving revision 1.296 diff -u -r1.296 rc --- etc/rc 17 Feb 2002 22:19:14 -0000 1.296 +++ etc/rc 12 Mar 2002 02:12:02 -0000 @@ -108,6 +108,15 @@ chkdepend NIS nis_server_enable portmap portmap_enable chkdepend NIS nis_client_enable portmap portmap_enable +# Enable dumpdev early so that a crash during the boot process can be caught. +# +case ${dumpdev} in +[Nn][Oo] | '') + ;; +*) + /sbin/dumpon -v ${dumpdev} +esac + # Enable harvesting of entropy via devices. The sooner this happens the # better so that we can take advantage of the boot process. # @@ -540,27 +549,23 @@ dev_mkdb fi -# Enable dumpdev so that savecore can see it. -# /var/crash should be a directory or a symbolic link +# $dumpdir should be a directory or a symbolic link # to the crash directory if core dumps are to be saved. # -case ${dumpdev} in -[Nn][Oo] | '') +case ${dumpdir} in +'') + dumpdir='/var/crash' ;; -*) - case ${dumpdir} in - '') - dumpdir='/var/crash' - ;; - esac - - if [ -e "${dumpdev}" -a -d "${dumpdir}" ]; then - /sbin/dumpon -v ${dumpdev} - echo -n 'Checking for core dump: ' - /sbin/savecore ${savecore_flags} "${dumpdir}" - fi +[Nn][Oo]) + dumpdir='NO' ;; esac + +if [ "$dumpdir" != 'NO' ]; then + echo -n 'Checking for core dump: ' + /sbin/savecore ${savecore_flags} "${dumpdir}" +fi + if [ -n "${network_pass1_done}" ]; then network_pass2 -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message