From nsayer@3do.com  Wed Oct  2 15:31:21 1996
Received: from outland (outland.3do.com [208.192.70.2])
          by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA11619
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 2 Oct 1996 15:31:14 -0700 (PDT)
Received: from badger.3do.com (badger.3do.com [198.211.30.7]) by outland (SMI-8.6/8.6.12) with SMTP id PAA08301 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 2 Oct 1996 15:30:33 -0700
Received: from jail.3do.com by badger.3do.com (4.1/SMI-4.1)
	id AA23111; Wed, 2 Oct 96 15:30:40 PDT
Received: by jail.3do.com 
        (8.7.5//ident-1.0) id PAA00369; Wed, 2 Oct 1996 15:30:39 -0700 (PDT) 
Message-Id: <199610022230.PAA00369@jail.3do.com>
Date: Wed, 2 Oct 1996 15:30:39 -0700 (PDT)
From: nsayer@kfu.com
Reply-To: nsayer@kfu.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: kernel logging of signaled processes should be optional
X-Send-Pr-Version: 3.2

>Number:         1711
>Category:       kern
>Synopsis:       kernel logging of signaled processes should be optional
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    joerg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct  2 15:40:01 PDT 1996
>Closed-Date:    Wed Jul 29 10:31:15 MEST 1998
>Last-Modified:  Wed Jul 29 10:31:43 MEST 1998
>Originator:     Nick Sayer
>Release:        FreeBSD 2.2-960801-SNAP i386
>Organization:
Just me
>Environment:

>Description:

kernel logging of signaled processes ("pid 99, uid 0: exited on
signal 11 (core dumped)") _really_ should have an option to
disable. Really now. If you can comment the source to indicate
that some found it annoying (it certainly bugs the hell out of
me), you can put an #ifndef in to allow folks to have their
choice.

>How-To-Repeat:

>Fix:
	
*** kern_sig.c.orig	Tue Jul  9 11:12:37 1996
--- kern_sig.c	Wed Oct  2 15:23:53 1996
***************
*** 1205,1215 ****
--- 1205,1217 ----
  		 */
  		if (coredump(p) == 0)
  			signum |= WCOREFLAG;
+ #ifndef NO_SIGEXIT_LOG
  		log(LOG_INFO, "pid %d (%s), uid %d: exited on signal %d%s\n",
  			p->p_pid, p->p_comm,
  			p->p_cred && p->p_ucred ? p->p_ucred->cr_uid : -1,
  			signum &~ WCOREFLAG,
  			signum & WCOREFLAG ? " (core dumped)" : "");
+ #endif
  	}
  	exit1(p, W_EXITCODE(0, signum));
  	/* NOTREACHED */

>Release-Note:
>Audit-Trail:

From: J Wunsch <j@uriah.heep.sax.de>
To: nsayer@kfu.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/1711: kernel logging of signaled processes should be optional
Date: Thu, 3 Oct 1996 14:25:13 +0200 (MET DST)

 As nsayer@kfu.com wrote:
 
 > kernel logging of signaled processes ("pid 99, uid 0: exited on
 > signal 11 (core dumped)") _really_ should have an option to
 > disable. Really now. If you can comment the source to indicate
 > that some found it annoying (it certainly bugs the hell out of
 > me), you can put an #ifndef in to allow folks to have their
 > choice.
 
 I would prefer a sysctl variable for this.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)

From: nsayer@quack.kfu.com
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/1711: kernel logging of signaled processes should be optional
Date: Tue, 18 Mar 1997 10:20:52 -0800 (PST)

 Ok, then here is the sysctl version of the same fix. It is not yet
 present in 2.2-RELEASE, and this patch does require some
 fuzz to apply, but it does apply and work:
 
 *** kern/kern_sig.c.orig	Tue Jul  9 11:12:37 1996
 --- kern/kern_sig.c	Thu Oct  3 16:40:32 1996
 ***************
 *** 61,66 ****
 --- 61,67 ----
   #include <sys/syslog.h>
   #include <sys/stat.h>
   #include <sys/sysent.h>
 + #include <sys/sysctl.h>
   
   #include <machine/cpu.h>
   
 ***************
 *** 1188,1193 ****
 --- 1189,1196 ----
    * If dumping core, save the signal number for the debugger.  Calls exit and
    * does not return.
    */
 + int kern_logsigexit=1;
 + 
   void
   sigexit(p, signum)
   	register struct proc *p;
 ***************
 *** 1205,1219 ****
   		 */
   		if (coredump(p) == 0)
   			signum |= WCOREFLAG;
 ! 		log(LOG_INFO, "pid %d (%s), uid %d: exited on signal %d%s\n",
 ! 			p->p_pid, p->p_comm,
 ! 			p->p_cred && p->p_ucred ? p->p_ucred->cr_uid : -1,
 ! 			signum &~ WCOREFLAG,
 ! 			signum & WCOREFLAG ? " (core dumped)" : "");
   	}
   	exit1(p, W_EXITCODE(0, signum));
   	/* NOTREACHED */
   }
   
   /*
    * Dump core, into a file named "progname.core", unless the process was
 --- 1208,1225 ----
   		 */
   		if (coredump(p) == 0)
   			signum |= WCOREFLAG;
 ! 		if (kern_logsigexit)
 ! 			log(LOG_INFO, "pid %d (%s), uid %d: exited on signal %d%s\n",
 ! 				p->p_pid, p->p_comm,
 ! 				p->p_cred && p->p_ucred ? p->p_ucred->cr_uid : -1,
 ! 				signum &~ WCOREFLAG,
 ! 				signum & WCOREFLAG ? " (core dumped)" : "");
   	}
   	exit1(p, W_EXITCODE(0, signum));
   	/* NOTREACHED */
   }
 +  
 + SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0, "");
   
   /*
    * Dump core, into a file named "progname.core", unless the process was
 *** sys/sysctl.h.orig	Thu Jul 25 11:02:14 1996
 --- sys/sysctl.h	Thu Oct  3 16:20:40 1996
 ***************
 *** 223,229 ****
   #define	KERN_MAXSOCKBUF		31	/* int: max size of a socket buffer */
   #define	KERN_PS_STRINGS		32	/* int: address of PS_STRINGS */
   #define	KERN_USRSTACK		33	/* int: address of USRSTACK */
 ! #define KERN_MAXID		34      /* number of valid kern ids */
   
   #define CTL_KERN_NAMES { \
   	{ 0, 0 }, \
 --- 223,230 ----
   #define	KERN_MAXSOCKBUF		31	/* int: max size of a socket buffer */
   #define	KERN_PS_STRINGS		32	/* int: address of PS_STRINGS */
   #define	KERN_USRSTACK		33	/* int: address of USRSTACK */
 ! #define	KERN_LOGSIGEXIT		34	/* int: do we log sigexit procs? */
 ! #define KERN_MAXID		35      /* number of valid kern ids */
   
   #define CTL_KERN_NAMES { \
   	{ 0, 0 }, \
 ***************
 *** 260,265 ****
 --- 261,267 ----
   	{ "maxsockbuf", CTLTYPE_INT }, \
   	{ "ps_strings", CTLTYPE_INT }, \
   	{ "usrstack", CTLTYPE_INT }, \
 + 	{ "logsigexit", CTLTYPE_INT }, \
   }
   
   /*
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Tue Mar 18 16:18:07 PST 1997 
Responsible-Changed-Why:  
Joerg said he would take responsibility for this PR. 
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Wed Jul 29 10:31:15 MEST 1998 
State-Changed-Why:  
Suggested fix applied in kern_sig.c rev 1.45. 
>Unformatted:
