From delphij@frontfree.net  Tue Mar  2 08:48:08 2004
Return-Path: <delphij@frontfree.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3B70816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Mar 2004 08:48:08 -0800 (PST)
Received: from ftp.bjpu.edu.cn (ftp.bjpu.edu.cn [202.112.78.5])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D847843D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Mar 2004 08:48:07 -0800 (PST)
	(envelope-from delphij@frontfree.net)
Received: from localhost (localhost [127.0.0.1])
	by ftp.bjpu.edu.cn (Postfix) with ESMTP id 332F552AB
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Mar 2004 00:48:06 +0800 (CST)
Received: from ftp.bjpu.edu.cn ([127.0.0.1])
 by localhost (ftp.bjpu.edu.cn [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 69495-09 for <FreeBSD-gnats-submit@freebsd.org>;
 Wed,  3 Mar 2004 00:48:05 +0800 (CST)
Received: from beastie.frontfree.net (beastie.frontfree.net [218.107.145.7])
	by ftp.bjpu.edu.cn (Postfix) with ESMTP id E20B652A0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Mar 2004 00:48:04 +0800 (CST)
Received: from localhost (localhost [127.0.0.1])
	by beastie.frontfree.net (Postfix) with ESMTP id 6EA6911CAD
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  3 Mar 2004 00:48:04 +0800 (CST)
Received: from beastie.frontfree.net ([127.0.0.1])
 by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 03266-03 for <FreeBSD-gnats-submit@freebsd.org>;
 Wed,  3 Mar 2004 00:48:02 +0800 (CST)
Received: by beastie.frontfree.net (Postfix, from userid 1001)
	id E352611C97; Wed,  3 Mar 2004 00:48:01 +0800 (CST)
Message-Id: <20040302164801.E352611C97@beastie.frontfree.net>
Date: Wed,  3 Mar 2004 00:48:01 +0800 (CST)
From: Xin LI <delphij@frontfree.net>
Reply-To: Xin LI <delphij@frontfree.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] make the startup savecore(8) to compress saved cores by default
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63648
>Category:       conf
>Synopsis:       [PATCH] make the startup savecore(8) to compress saved cores by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 02 08:50:19 PST 2004
>Closed-Date:    Sat Mar 06 01:59:06 PST 2004
>Last-Modified:  Sat Mar 06 01:59:06 PST 2004
>Originator:     Xin LI
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
The FreeBSD Simplified Chinese Project
>Environment:
System: FreeBSD beastie.frontfree.net 5.2-CURRENT FreeBSD 5.2-CURRENT #40: Tue Mar 2 17:38:46 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386

>Description:
	The savecore(8) provided the ablity to save kernel dumps 
after a crash, also, it can save gzip(1)'ed copies of the coredumps. 
On a machine having big RAM, it will be a nightmare to have many 
coredumps saved in /var/crash, and compressing it by default will 
make unattended boxes possible to have more dumps saved.
	For users do not want to save a compressed coredumps, it 
is always possible to set savecore_flags="" in rc.conf. 
>How-To-Repeat:
>Fix:

	I proposal the attached patch against src/etc/defaults/rc.conf.

--- patch-rc.conf begins here ---
Index: rc.conf
===================================================================
RCS file: /home/mirror/freebsd/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.198
diff -u -r1.198 rc.conf
--- rc.conf	3 Feb 2004 11:26:08 -0000	1.198
+++ rc.conf	2 Mar 2004 16:37:04 -0000
@@ -409,7 +409,7 @@
 usbd_flags=""		# Flags to usbd (if enabled).
 dumpdev="NO"		# Device name to crashdump to (or NO).
 dumpdir="/var/crash"	# Directory where crash dumps are to be stored
-savecore_flags=""	# Used if dumpdev is enabled above, and present.
+savecore_flags="-z"	# Used if dumpdev is enabled above, and present.
 enable_quotas="NO"	# turn on quotas on startup (or NO).
 check_quotas="YES"	# Check quotas on startup (or NO).
 accounting_enable="NO"	# Turn on process accounting (or NO).
--- patch-rc.conf ends here ---


>Release-Note:
>Audit-Trail:

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Xin LI <delphij@frontfree.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/63648: [PATCH] make the startup savecore(8) to compress saved cores by default
Date: Tue, 2 Mar 2004 20:12:52 +0200

 On Wed, Mar 03, 2004 at 12:48:01AM +0800, Xin LI wrote:
 [...]
 > On a machine having big RAM, it will be a nightmare to have many 
 > coredumps saved in /var/crash, and compressing it by default will 
 > make unattended boxes possible to have more dumps saved.
 > 	For users do not want to save a compressed coredumps, it 
 > is always possible to set savecore_flags="" in rc.conf. 
 > 
 > Index: rc.conf
 [...]
 > -savecore_flags=""	# Used if dumpdev is enabled above, and present.
 > +savecore_flags="-z"	# Used if dumpdev is enabled above, and present.
 
 I don't see much point making it the default, as it violates POLA.
 Many users expect ``gdb -k'' to just work, without needing to
 uncompress core first.
 
 
 Cheers,
 -- 
 Ruslan Ermilov
 FreeBSD committer
 ru@FreeBSD.org

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Xin LI <delphij@frontfree.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/63648: [PATCH] make the startup savecore(8) to compress saved cores by default
Date: Wed, 3 Mar 2004 10:24:29 +0200

 On Wed, Mar 03, 2004 at 08:42:44AM +0800, Xin LI wrote:
 > Hello, Ruslan
 > 
 > On Tue, Mar 02, 2004 at 08:12:52PM +0200, Ruslan Ermilov wrote:
 > [...]
 > > [...]
 > > > -savecore_flags=""	# Used if dumpdev is enabled above, and present.
 > > > +savecore_flags="-z"	# Used if dumpdev is enabled above, and present.
 > > 
 > > I don't see much point making it the default, as it violates POLA.
 > > Many users expect ``gdb -k'' to just work, without needing to
 > > uncompress core first.
 > [...]
 > 
 > It seems reasonable to me about the POLA violation, thank you
 > for pointing this out. 
 > 
 > Frankly, one of my friends is running a box with 4GB of RAM and
 > having many 4GB'sized coredumps on his /var/crash is really not
 > an interesting thing...
 > 
 > Another possible approach is to have older coredumps compressed
 > after the system is started up, what do you think about this idea?
 > 
 I think those that need it just need to set -z in savecore_flags.
 After all, it's there just to be able to do that.  ;)
 
 
 Cheers,
 -- 
 Ruslan Ermilov
 FreeBSD committer
 ru@FreeBSD.org

From: Kris Kennaway <kris@obsecurity.org>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/63648: [PATCH] make the startup savecore(8) to compress saved cores by default
Date: Sat, 6 Mar 2004 00:50:03 -0800

 On Tue, Mar 02, 2004 at 10:20:10AM -0800, Ruslan Ermilov wrote:
 > The following reply was made to PR conf/63648; it has been noted by GNATS.
 > 
 > From: Ruslan Ermilov <ru@FreeBSD.org>
 > To: Xin LI <delphij@frontfree.net>
 > Cc: bug-followup@FreeBSD.org
 > Subject: Re: conf/63648: [PATCH] make the startup savecore(8) to compress saved cores by default
 > Date: Tue, 2 Mar 2004 20:12:52 +0200
 > 
 >  On Wed, Mar 03, 2004 at 12:48:01AM +0800, Xin LI wrote:
 >  [...]
 >  > On a machine having big RAM, it will be a nightmare to have many 
 >  > coredumps saved in /var/crash, and compressing it by default will 
 >  > make unattended boxes possible to have more dumps saved.
 >  > 	For users do not want to save a compressed coredumps, it 
 >  > is always possible to set savecore_flags="" in rc.conf. 
 >  > 
 >  > Index: rc.conf
 >  [...]
 >  > -savecore_flags=""	# Used if dumpdev is enabled above, and present.
 >  > +savecore_flags="-z"	# Used if dumpdev is enabled above, and present.
 >  
 >  I don't see much point making it the default, as it violates POLA.
 >  Many users expect ``gdb -k'' to just work, without needing to
 >  uncompress core first.
 
 I agree..as you say in your other response, that's what the variable is there for.
 
 Kris
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Mar 6 01:58:49 PST 2004 
State-Changed-Why:  
Closed at submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63648 
>Unformatted:
