From owner-freebsd-bugs@freebsd.org Wed Jan 6 00:42:37 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDB8A63C5B for ; Wed, 6 Jan 2016 00:42:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1EA71C5F for ; Wed, 6 Jan 2016 00:42:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u060gbAc093945 for ; Wed, 6 Jan 2016 00:42:37 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 178396] [kernel] [patch] Add jid to kernel log when a process has been forced closed Date: Wed, 06 Jan 2016 00:42:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: thomas@gibfest.dk X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 00:42:38 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D178396 thomas@gibfest.dk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thomas@gibfest.dk --- Comment #3 from thomas@gibfest.dk --- Created attachment 165129 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D165129&action= =3Dedit updated patch against stable/10 r293209 The original attachment in this bug no longer works since it doesn't use the newish jailed() to check if the process is jailed.=20 The attachment I'm adding is a patch against stable/10 base r293209 which f= ixes the jailed detection, and also adds jail hostname to the log entry (when a = jail hostname is available). For this patch to work on HEAD the exit1() call needs to be changed, no oth= er changes needed I think. This patch could be a few lines shorter by only having one log() call, which includes a empty string for nonjailed processes and something like ", jid: = xxx (example.com)" for jailed processes. The current is arguably more readable though. Testing with this patch applied: ------------------------------------------------- [tykling@test /usr/src]$ sudo jail -c path=3D/ command=3D/bin/sh # perl -e 'dump' Abort trap (core dumped) # ^Djail: /bin/sh: failed [tykling@test /usr/src]$ sudo jail -c path=3D/ host.hostname=3Dexample.com command=3D/bin/sh # perl -e 'dump' Abort trap (core dumped) # ^Djail: /bin/sh: failed [tykling@test /usr/src]$ perl -e 'dump' Abort trap [tykling@test /usr/src]$ dmesg | tail -3 pid 847 (perl), uid 0, jid 3: exited on signal 6 (core dumped) pid 853 (perl), uid 0, jid 4 (example.com): exited on signal 6 (core dumped) pid 857 (perl), uid 1001: exited on signal 6 [tykling@test /usr/src]$ ------------------------------------------------- I am not good with C so please feel free to comment on style and other problems. Thanks :) --=20 You are receiving this mail because: You are the assignee for the bug.=