Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Jan 2016 09:00:05 +0000
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
Message-ID:  <bug-178396-8-ag55jovdO3@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-178396-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-178396-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D178396

Thomas Steen Rasmussen / Tykling <thomas@gibfest.dk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #165129|0                           |1
        is obsolete|                            |

--- Comment #5 from Thomas Steen Rasmussen / Tykling <thomas@gibfest.dk> ---
Created attachment 165148
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D165148&action=
=3Dedit
updated patch with jailname instead of hostname

Thanks for the review! I've updated the patch to:
- use the jailname instead of hostname
- leave out the jid
- show jail info in the beginning of the line

Testing now looks like this with the patch applied:
----------------------------------------------------
[tykling@test /usr/src]$ sudo jail -n testname -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/ 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
[testname] pid 823 (perl), uid 0: exited on signal 6 (core dumped)
[6] pid 827 (perl), uid 0: exited on signal 6 (core dumped)
pid 828 (perl), uid 1001: exited on signal 6
[tykling@test /usr/src]$
----------------------------------------------------

There doesn't seem to be a getcred* function to get the jail name, so I've =
left
that code as is, but getting pr_name instead of pr_hostname.

Only thing missing is getting the parent jail names (recursively) where
relevant. Do you happen to know if there is an existing function to do that=
, or
do I have to make one and call it recursively, prepending to a . seperated
string until pr_parent is null?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-178396-8-ag55jovdO3>