Date: Tue, 6 Apr 2010 14:47:26 GMT From: "David E. Cross" <dcross@okcupid.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/145434: Kernel messages about processes don't include Jail Identifier Message-ID: <201004061447.o36ElQSG030692@www.freebsd.org> Resent-Message-ID: <201004061450.o36Eo4IM011958@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 145434 >Category: kern >Synopsis: Kernel messages about processes don't include Jail Identifier >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Apr 06 14:50:04 UTC 2010 >Closed-Date: >Last-Modified: >Originator: David E. Cross >Release: 8.0-RELEASE-amd64 >Organization: Humor Rainbow Inc. >Environment: FreeBSD foo.bar.baz 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Mon Apr 5 14:42:00 EDT 2010 root@foo.bar.baz:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Processes which exit abnormally display a kernel message to this effect that includes some basic information about the process. Its PID, its UID, its name. On a machine with a lot of jails, this information can be essentially useless. Consider a webhost with 50 jails serving PHP via fastcgi and one is crashing, its near impossible to track it down with just the information as currently provided. >How-To-Repeat: Try to trace down a coredump on a machine with lots of jails >Fix: Apply the included patch. Patch attached with submission follows: --- sys/kern/kern_sig.c.orig 2009-10-24 21:10:29.000000000 -0400 +++ sys/kern/kern_sig.c 2010-04-06 10:44:42.000000000 -0400 @@ -57,6 +57,8 @@ #include <sys/mutex.h> #include <sys/namei.h> #include <sys/proc.h> +#include <sys/ucred.h> +#include <sys/jail.h> #include <sys/posix4.h> #include <sys/pioctl.h> #include <sys/resourcevar.h> @@ -2733,8 +2735,9 @@ sig |= WCOREFLAG; if (kern_logsigexit) log(LOG_INFO, - "pid %d (%s), uid %d: exited on signal %d%s\n", + "pid %d (%s), jid %d, uid %d: exited on signal %d%s\n", p->p_pid, p->p_comm, + (td->td_ucred && td->td_ucred->cr_prison) ? td->td_ucred->cr_prison->pr_id : 0, td->td_ucred ? td->td_ucred->cr_uid : -1, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004061447.o36ElQSG030692>