From nobody@FreeBSD.org  Sun Nov  3 13:02:16 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id A94B5EFE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Nov 2013 13:02:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 7D0BE2D8A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Nov 2013 13:02:16 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rA3D2Gbq010313
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 3 Nov 2013 13:02:16 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rA3D2GpW010312;
	Sun, 3 Nov 2013 13:02:16 GMT
	(envelope-from nobody)
Message-Id: <201311031302.rA3D2GpW010312@oldred.freebsd.org>
Date: Sun, 3 Nov 2013 13:02:16 GMT
From: Florian Heigl <florian.heigl@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: linprocfs: emulate /proc/sys/kernel/random/uuid
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183615
>Category:       kern
>Synopsis:       [linprocfs] [patch] emulate /proc/sys/kernel/random/uuid
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 03 13:10:00 UTC 2013
>Closed-Date:    Thu Feb 20 17:43:43 UTC 2014
>Last-Modified:  Thu Feb 20 17:43:43 UTC 2014
>Originator:     Florian Heigl
>Release:        9.1-STABLE#0
>Organization:
>Environment:
FreeBSD freebsd1 9.1-STABLE FreeBSD 9.1-STABLE #0: Sun Jul  7 23:12:23 EEST 2013     root@freebsd:/usr/obj/usr/src/sys/XENHVM  amd64
FreeBSD freebsd1 9.1-STABLE FreeBSD 9.1-STABLE #0: Sun Jul  7 23:12:23 EEST 2013     root@freebsd:/usr/obj/usr/src/sys/XENHVM  amd64

>Description:
I followed (somewhat) the debian document about setting up a Debian Jail on FreeBSD at https://wiki.debian.org/Debian_GNU/kFreeBSD/Jails

Using the Linux module and mounting some filesystems I have this working OK and can ssh into it. With this, I'm trying to make some software available to FreeBSD.

linprocfs          4       4        0   100%    /srv/jail/debjail/proc
linsysfs           4       4        0   100%    /srv/jail/debjail/sys
tmpfs          36068      60    36008     0%    /srv/jail/debjail/run
devfs              1       1        0   100%    /srv/jail/debjail/dev
linprocfs          4       4        0   100%    /usr/compat/linux/proc

A problem I hit is that some application (in this case: Check_MK multisite) uses the procfs to gain easy access to uuid's for session handling and object id's.

What they do is: 
root@debjail:/omd/sites/freemon# grep -R "random/uuid" *
share/check_mk/web/htdocs/weblib.py:        sel_id = file('/proc/sys/kernel/random/uuid').read().strip()



In linprocfs we don't have this file available, or actually the whole directory ain't there:
builder@debjail:/build$ ls /proc/sys/kernel/
msgmni  osrelease  ostype  pid_max  sem  version


The following things are in there on Linux:
$ ls /proc/sys/kernel/random
boot_id        poolsize               uuid
entropy_avail  read_wakeup_threshold  write_wakeup_threshold

Could anyone look into this? 
in case of "uuid" it seems there's a FreeBSD system call that gives back an uuid.


Myself I'll try and see if i can create a pipe or something in that place that gives back a uuid on read?
>How-To-Repeat:
mount linux procfs, check for existance of /proc/sys/kernel/random/uuid

should be accessible like this:
$ cat /proc/sys/kernel/random/uuid 
bee78388-ce08-450a-be12-dcbbc6c4f3f1

(but isn't since we don't got it)
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Nov 6 04:23:39 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183615 

From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= <fernando.apesteguia@gmail.com>
To: bug-followup@FreeBSD.org, florian.heigl@gmail.com
Cc:  
Subject: Re: kern/183615: [linprocfs] emulate /proc/sys/kernel/random/uuid
Date: Thu, 7 Nov 2013 00:02:47 +0100

 --f46d0444ed39d5772f04ea8a2556
 Content-Type: multipart/alternative; boundary=f46d0444ed39d5772a04ea8a2554
 
 --f46d0444ed39d5772a04ea8a2554
 Content-Type: text/plain; charset=ISO-8859-1
 
 Would you like to try this patch?
 
 --f46d0444ed39d5772a04ea8a2554
 Content-Type: text/html; charset=ISO-8859-1
 
 <div dir="ltr"><div>Would you like to try this patch?<br><br></div></div>
 
 --f46d0444ed39d5772a04ea8a2554--
 --f46d0444ed39d5772f04ea8a2556
 Content-Type: text/x-patch; charset=US-ASCII; name="linprocfs-random.patch"
 Content-Disposition: attachment; filename="linprocfs-random.patch"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_hnp695gx0
 
 LS0tIGNvbXBhdC9saW5wcm9jZnMvbGlucHJvY2ZzLmMub3JpZwkyMDEzLTExLTA2IDE4OjU5OjQx
 LjAwMDAwMDAwMCArMDEwMAorKysgY29tcGF0L2xpbnByb2Nmcy9saW5wcm9jZnMuYwkyMDEzLTEx
 LTA2IDIzOjU2OjIyLjAwMDAwMDAwMCArMDEwMApAQCAtNzIsNiArNzIsNyBAQAogI2luY2x1ZGUg
 PHN5cy90aW1lLmg+CiAjaW5jbHVkZSA8c3lzL3R0eS5oPgogI2luY2x1ZGUgPHN5cy91c2VyLmg+
 CisjaW5jbHVkZSA8c3lzL3V1aWQuaD4KICNpbmNsdWRlIDxzeXMvdm1tZXRlci5oPgogI2luY2x1
 ZGUgPHN5cy92bm9kZS5oPgogI2luY2x1ZGUgPHN5cy9idXMuaD4KQEAgLTEzNDcsNiArMTM0OCwy
 MyBAQAogCXJldHVybiAoMCk7CiB9CiAKKworLyoKKyAqIEZpbGxlciBmdW5jdGlvbiBmb3IgcHJv
 Yy9zeXMva2VybmVsL3JhbmRvbS91dWlkCisgKi8KK3N0YXRpYyBpbnQKK2xpbnByb2Nmc19kb3V1
 aWQoUEZTX0ZJTExfQVJHUykKK3sKKwlzdHJ1Y3QgdXVpZCB1dWlkOworCisJa2Vybl91dWlkZ2Vu
 KCZ1dWlkLCAxKTsKKworCXNidWZfcHJpbnRmX3V1aWQoc2IsICZ1dWlkKTsKKwlzYnVmX3ByaW50
 ZihzYiwgIlxuIik7CisKKwlyZXR1cm4oMCk7Cit9CisKIC8qCiAgKiBDb25zdHJ1Y3RvcgogICov
 CkBAIC0xNDQ1LDYgKzE0NjMsOCBAQAogCSAgICBOVUxMLCBOVUxMLCBOVUxMLCBQRlNfUkQpOwog
 CXBmc19jcmVhdGVfZmlsZShkaXIsICJzZW0iLCAmbGlucHJvY2ZzX2Rvc2VtLAogCSAgICBOVUxM
 LCBOVUxMLCBOVUxMLCBQRlNfUkQpOworCXBmc19jcmVhdGVfZmlsZShkaXIsICJyYW5kb20iLCAm
 bGlucHJvY2ZzX2RvdXVpZCwKKwkgICAgTlVMTCwgTlVMTCwgTlVMTCwgUEZTX1JEKTsKIAogCXJl
 dHVybiAoMCk7CiB9Cg==
 --f46d0444ed39d5772f04ea8a2556--

From: Florian Heigl <florian.heigl@gmail.com>
To: =?windows-1252?Q?Fernando_Apestegu=EDa?= <fernando.apesteguia@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/183615: [linprocfs] emulate /proc/sys/kernel/random/uuid
Date: Thu, 7 Nov 2013 09:07:51 +0100

 Hi,
 
 Thank you very much for the patch.
 I will gladly test it, I=92ll try to do it on the weekend.
 
 Florian
 On 07.11.2013, at 00:02, Fernando Apestegu=EDa =
 <fernando.apesteguia@gmail.com> wrote:
 
 > Would you like to try this patch?
 >=20
 > <linprocfs-random.patch>
 
Responsible-Changed-From-To: freebsd-emulation->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Feb 18 03:15:53 UTC 2014 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183615 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Thu Feb 20 17:43:43 UTC 2014 
State-Changed-Why:  
Per submitter request 

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