From owner-freebsd-hackers@freebsd.org Mon Sep 4 06:51:12 2017 Return-Path: Delivered-To: freebsd-hackers@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 9F60FE17E28 for ; Mon, 4 Sep 2017 06:51:12 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 30BB967B7C for ; Mon, 4 Sep 2017 06:51:11 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id A11EE9D1AC for ; Mon, 4 Sep 2017 06:51:58 +0000 (UTC) Received: from [192.168.43.173] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 676119D1A3 for ; Mon, 4 Sep 2017 06:51:58 +0000 (UTC) Subject: Re: devd in jail To: freebsd-hackers@freebsd.org References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> From: Giulio Ferro Message-ID: <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> Date: Mon, 4 Sep 2017 08:51:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 06:51:12 -0000 On 10/08/2017 22:54, Alexander Leidinger wrote: > > Quoting Alan Somers (from Wed, 9 Aug 2017 > 13:14:20 -0600): > >> On Wed, Aug 9, 2017 at 12:47 PM, Giulio Ferro >> wrote: >>> Hello all, >>> >>> Setup : 11.1-STABLE FreeBSD 11.1-STABLE #0 r321925M amd64 >>> >>> >>> I'm trying to create a fully virtualized desktop enviroment in a >>> jail by >>> means of installing there >>> a xrdp-devel server + Xorg installation (xorg + xorgrdp). >>> >>> Everything seems to work until the moment when the X server actually >>> tries >>> to come up (after I choose session=xorg, username + password) >>> In the X logs in the jail, in fact, I have this error: >>> >>> ... >>> [ 9768.824] (EE) config/devd: fail to connect to devd >>> [ 9768.824] [config] failed to initialise devd >>> >>> >>> I've checked on the host machine, and I don't have that error as >>> everything >>> works fine there... >>> >>> In my jail, I've setup the devfs like this (/etc/jail.conf in the >>> host): >>> >>> --- >>> exec.start="/bin/sh /etc/rc"; >>> exec.stop="/bin/sh /etc/rc.shutdown"; >>> exec.clean; >>> mount.devfs; >>> devfs_ruleset=1; >>> >>> path="/usr/home/jail/$name"; >>> >>> myjail { >>> host.hostname="myjail.me.com"; >>> vnet; >>> vnet.interface = epair0b, epair1b; >>> persist; >>> } >>> --- >>> >>> >>> and in the /etc/devfs.conf everythink is commented out. >>> >>> In the /dev directory in the jail, I get both the devctl and devctl2 >>> devices. >>> >>> As the devd demon is not running in the jail, I've tried adding >>> devd_enable="YES" >>> >>> in the rc.conf (jail), but when I try to start it, I get: >>> >>> # /etc/rc.d/devd start >>> Starting devd. >>> devd: Can't open devctl device /dev/devctl: Device busy >>> /etc/rc.d/devd: WARNING: failed to start devd >>> >>> >>> Do you know if I'm doing something wrong, or there's a proper way to >>> have >>> devd running in the jail? >>> >>> I've thought that maybe I should use the devtcl2 device, as the >>> devctl is >>> used by the host, >>> but I don't know how to specify that to devd... >>> >>> Thanks in advance for your help. >>> >>> Giulio >> >> Unfortunately, you're not going to be able to run devd(8) in the jail. >> /dev/devctl can be opened by only one reader at a time, and that >> reader is always devd(8). /dev/devctl2 is actually a completely >> different device with a totally different interface. Apologies for >> the confusing names. But you may not need to run a totally separate >> instance of devd. The X server is probably trying to open either >> /var/run/devd.pipe or /var/run/devd.seqpacket.pipe. ktrace would tell >> you which. If you can bridge those sockets into the jail, then X >> would probably run. > > Apart from using an explicit config of devices instead of HAL / devd, > if this is a X server connecting to a graphics card (instead of just a > remote accessible framebuffer), the X-in-a-jail patches are needed, as > the X server needs access to /dev/(k)mem and /dev/io (and /dev/drm). > Hi Alexander, as I said, I don't actually need to connect to any device, as this Xorg server in the jail only uses xrdp as backend. > ATTENTION: doing this compromises the complete security of the entire > machine. The jail with the X-server can then access the entire memory > of the machine, this means circumventing any kernel-level security > protection / jail restrictions. Can you confirm that the following patch is everything I need to run Xorg in a jail in a 11.1 stable system? > > Using the PR_ALLOW_* flags from current in 11.1 is ok (sys/sys/jail.h): > ---snip--- > /* Flags for pr_allow */ > #define PR_ALLOW_SET_HOSTNAME 0x00000001 > #define PR_ALLOW_SYSVIPC 0x00000002 > #define PR_ALLOW_RAW_SOCKETS 0x00000004 > #define PR_ALLOW_CHFLAGS 0x00000008 > #define PR_ALLOW_MOUNT 0x00000010 > #define PR_ALLOW_QUOTAS 0x00000020 > #define PR_ALLOW_SOCKET_AF 0x00000040 > #define PR_ALLOW_MOUNT_DEVFS 0x00000080 > #define PR_ALLOW_MOUNT_NULLFS 0x00000100 > #define PR_ALLOW_MOUNT_ZFS 0x00000200 > #define PR_ALLOW_MOUNT_PROCFS 0x00000400 > #define PR_ALLOW_MOUNT_TMPFS 0x00000800 > #define PR_ALLOW_MOUNT_FDESCFS 0x00001000 > #define PR_ALLOW_MOUNT_LINPROCFS 0x00002000 > #define PR_ALLOW_MOUNT_LINSYSFS 0x00004000 > #define PR_ALLOW_RESERVED_PORTS 0x00008000 > #define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved, > not used yet */ > #define PR_ALLOW_ALL 0x0001ffff > ---snip--- > > Then kern_jail.c needs a little patch: > ---snip--- > Index: sys/kern/kern_jail.c > =================================================================== > --- sys/kern/kern_jail.c (revision 321365) > +++ sys/kern/kern_jail.c (working copy) > @@ -200,6 +200,7 @@ > "allow.mount.linprocfs", > "allow.mount.linsysfs", > "allow.reserved_ports", > + "allow.kmem_access", > }; > const size_t pr_allow_names_size = sizeof(pr_allow_names); > > @@ -220,6 +221,7 @@ > "allow.mount.nolinprocfs", > "allow.mount.nolinsysfs", > "allow.noreserved_ports", > + "allow.nokmem_access", > }; > const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); > > @@ -3344,6 +3346,27 @@ > return (0); > > /* > + * Allow access to /dev/io in a jail if the non-jailed > admin > + * requests this and if /dev/io exists in the jail. This > + * allows Xorg to probe a card. > + */ > + case PRIV_IO: > + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) > + return (0); > + else > + return (EPERM); > + > + /* > + * Allow low level access to KMEM-like devices (e.g. to > + * allow Xorg to use DRI). > + */ > + case PRIV_KMEM_WRITE: > + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) > + return (0); > + else > + return (EPERM); > + > + /* > * Allow jailed root to set loginclass. > */ > case PRIV_PROC_SETLOGINCLASS: > ---snip--- > > For 11.1 one little change is needed to get DRM access... see > https://svnweb.freebsd.org/changeset/base/320827 > > The jail then needs to be started with "allow.kmem_access" and > appropriate devfs rules (the jail needs rule 15 or 18, you may want to > give more or less access, depending on your needs, review with care): > ---snip--- > [devfsrules_unhide_audio=5] > add path 'audio*' unhide > add path 'dsp*' unhide > add path midistat unhide > add path 'mixer*' unhide > add path 'music*' unhide > add path 'sequencer*' unhide > add path sndstat unhide > add path speaker unhide > > [devfsrules_unhide_input=7] > add path 'atkbd*' unhide > add path 'kbd*' unhide > add path 'joy*' unhide > add path 'psm*' unhide > add path sysmouse unhide > add path 'ukbd*' unhide > add path 'ums*' unhide > > [devfsrules_unhide_xorg=8] > add path agpgart unhide > #add path console unhide > add path dri unhide > add path 'dri/card*' unhide > add path nvidiactl unhide > add path 'nvidia*' unhide > add path io unhide > add path mem unhide > add path pci unhide > add path tty unhide > add path ttyv0 unhide > add path ttyv1 unhide > add path ttyv8 unhide > > [devfsrules_unhide_kmem=11] > add path kmem unhide > > [devfsrules_unhide_zfs=12] > add path zfs unhide > > # > # This allows to run a desktop system in a jail. Think about what you > want to > # achieve before you use this, it opens up the entire machine to > access from > # this jail to any sophisticated program. > # > [devfsrules_jail_desktop=15] > add include $devfsrules_hide_all > add include $devfsrules_unhide_basic > add include $devfsrules_unhide_login > add include $devfsrules_unhide_audio > add include $devfsrules_unhide_input > add include $devfsrules_unhide_xorg > add include $devfsrules_unhide_kmem > > [devfsrules_jail_desktop_withzfs=18] > add include $devfsrules_hide_all > add include $devfsrules_unhide_basic > add include $devfsrules_unhide_login > add include $devfsrules_unhide_audio > add include $devfsrules_unhide_input > add include $devfsrules_unhide_xorg > add include $devfsrules_unhide_kmem > add include $devfsrules_unhide_zfs > ---snip--- > > Bye, > Alexander. > Thanks Giulio From owner-freebsd-hackers@freebsd.org Mon Sep 4 06:54:37 2017 Return-Path: Delivered-To: freebsd-hackers@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 16E9AE18234 for ; Mon, 4 Sep 2017 06:54:37 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 9F90168039 for ; Mon, 4 Sep 2017 06:54:36 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 5602E9D1AB for ; Mon, 4 Sep 2017 06:47:00 +0000 (UTC) Received: from [192.168.43.173] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 8C8F19D1A3 for ; Mon, 4 Sep 2017 06:46:59 +0000 (UTC) Subject: Re: devd in jail To: freebsd-hackers@freebsd.org References: From: Giulio Ferro Message-ID: <2a0d4a6f-003b-fcba-bd3a-31937bdb1b9f@zirakzigil.org> Date: Mon, 4 Sep 2017 08:46:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 06:54:37 -0000 On 09/08/2017 21:14, Alan Somers wrote: > On Wed, Aug 9, 2017 at 12:47 PM, Giulio Ferro wrote: >> Hello all, >> >> Setup : 11.1-STABLE FreeBSD 11.1-STABLE #0 r321925M amd64 >> >> >> I'm trying to create a fully virtualized desktop enviroment in a jail by >> means of installing there >> a xrdp-devel server + Xorg installation (xorg + xorgrdp). >> >> Everything seems to work until the moment when the X server actually tries >> to come up (after I choose session=xorg, username + password) >> In the X logs in the jail, in fact, I have this error: >> >> ... >> [ 9768.824] (EE) config/devd: fail to connect to devd >> [ 9768.824] [config] failed to initialise devd >> >> >> I've checked on the host machine, and I don't have that error as everything >> works fine there... >> >> In my jail, I've setup the devfs like this (/etc/jail.conf in the host): >> >> --- >> exec.start="/bin/sh /etc/rc"; >> exec.stop="/bin/sh /etc/rc.shutdown"; >> exec.clean; >> mount.devfs; >> devfs_ruleset=1; >> >> path="/usr/home/jail/$name"; >> >> myjail { >> host.hostname="myjail.me.com"; >> vnet; >> vnet.interface = epair0b, epair1b; >> persist; >> } >> --- >> >> >> and in the /etc/devfs.conf everythink is commented out. >> >> In the /dev directory in the jail, I get both the devctl and devctl2 >> devices. >> >> As the devd demon is not running in the jail, I've tried adding >> devd_enable="YES" >> >> in the rc.conf (jail), but when I try to start it, I get: >> >> # /etc/rc.d/devd start >> Starting devd. >> devd: Can't open devctl device /dev/devctl: Device busy >> /etc/rc.d/devd: WARNING: failed to start devd >> >> >> Do you know if I'm doing something wrong, or there's a proper way to have >> devd running in the jail? >> >> I've thought that maybe I should use the devtcl2 device, as the devctl is >> used by the host, >> but I don't know how to specify that to devd... >> >> Thanks in advance for your help. >> >> Giulio > Unfortunately, you're not going to be able to run devd(8) in the jail. > /dev/devctl can be opened by only one reader at a time, and that > reader is always devd(8). /dev/devctl2 is actually a completely > different device with a totally different interface. Apologies for > the confusing names. But you may not need to run a totally separate > instance of devd. The X server is probably trying to open either > /var/run/devd.pipe or /var/run/devd.seqpacket.pipe. ktrace would tell > you which. If you can bridge those sockets into the jail, then X > would probably run. > > -Alan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" Hi Alan, sorry for the late feedback and thanks for your advice. Unfortunately I haven't found a way to bridge (as you say) the relevant pipe files to the jail. I've tried to mount_nullfs the host /var/run to the jail /var/run, but with tragic results, as the jail deletes the /var/run content when it starts up. Do you have some better way to do that? I ask because this may be more convenient venue compared to apply the patches, and more portable in case of updates, etc... Thanks Giulio From owner-freebsd-hackers@freebsd.org Tue Sep 5 12:32:59 2017 Return-Path: Delivered-To: freebsd-hackers@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 6B2CDE06BFA for ; Tue, 5 Sep 2017 12:32:59 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id F324639D for ; Tue, 5 Sep 2017 12:32:58 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 683F19D1AD; Tue, 5 Sep 2017 12:33:41 +0000 (UTC) Received: from [192.168.43.15] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 2D02A9D1A6; Tue, 5 Sep 2017 12:33:41 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: devd in jail From: Giulio Ferro X-Mailer: iPhone Mail (14G60) In-Reply-To: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> Date: Tue, 5 Sep 2017 14:32:50 +0200 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <415A2FDD-F02E-44BF-862F-FA928EACB454@zirakzigil.org> References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> To: Alexander Leidinger X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 12:32:59 -0000 Hi Alexander, This set of patches doesn't seem to apply to 11.1 stable, am I right? > Il giorno 10 ago 2017, alle ore 22:54, Alexander Leidinger ha scritto: >=20 >=20 > Quoting Alan Somers (from Wed, 9 Aug 2017 13:14:20 -= 0600): >=20 >>> On Wed, Aug 9, 2017 at 12:47 PM, Giulio Ferro wro= te: >>> Hello all, >>>=20 >>> Setup : 11.1-STABLE FreeBSD 11.1-STABLE #0 r321925M amd64 >>>=20 >>>=20 >>> I'm trying to create a fully virtualized desktop enviroment in a jail by= >>> means of installing there >>> a xrdp-devel server + Xorg installation (xorg + xorgrdp). >>>=20 >>> Everything seems to work until the moment when the X server actually tri= es >>> to come up (after I choose session=3Dxorg, username + password) >>> In the X logs in the jail, in fact, I have this error: >>>=20 >>> ... >>> [ 9768.824] (EE) config/devd: fail to connect to devd >>> [ 9768.824] [config] failed to initialise devd >>>=20 >>>=20 >>> I've checked on the host machine, and I don't have that error as everyth= ing >>> works fine there... >>>=20 >>> In my jail, I've setup the devfs like this (/etc/jail.conf in the host):= >>>=20 >>> --- >>> exec.start=3D"/bin/sh /etc/rc"; >>> exec.stop=3D"/bin/sh /etc/rc.shutdown"; >>> exec.clean; >>> mount.devfs; >>> devfs_ruleset=3D1; >>>=20 >>> path=3D"/usr/home/jail/$name"; >>>=20 >>> myjail { >>> host.hostname=3D"myjail.me.com"; >>> vnet; >>> vnet.interface =3D epair0b, epair1b; >>> persist; >>> } >>> --- >>>=20 >>>=20 >>> and in the /etc/devfs.conf everythink is commented out. >>>=20 >>> In the /dev directory in the jail, I get both the devctl and devctl2 >>> devices. >>>=20 >>> As the devd demon is not running in the jail, I've tried adding >>> devd_enable=3D"YES" >>>=20 >>> in the rc.conf (jail), but when I try to start it, I get: >>>=20 >>> # /etc/rc.d/devd start >>> Starting devd. >>> devd: Can't open devctl device /dev/devctl: Device busy >>> /etc/rc.d/devd: WARNING: failed to start devd >>>=20 >>>=20 >>> Do you know if I'm doing something wrong, or there's a proper way to hav= e >>> devd running in the jail? >>>=20 >>> I've thought that maybe I should use the devtcl2 device, as the devctl i= s >>> used by the host, >>> but I don't know how to specify that to devd... >>>=20 >>> Thanks in advance for your help. >>>=20 >>> Giulio >>=20 >> Unfortunately, you're not going to be able to run devd(8) in the jail. >> /dev/devctl can be opened by only one reader at a time, and that >> reader is always devd(8). /dev/devctl2 is actually a completely >> different device with a totally different interface. Apologies for >> the confusing names. But you may not need to run a totally separate >> instance of devd. The X server is probably trying to open either >> /var/run/devd.pipe or /var/run/devd.seqpacket.pipe. ktrace would tell >> you which. If you can bridge those sockets into the jail, then X >> would probably run. >=20 > Apart from using an explicit config of devices instead of HAL / devd, if t= his is a X server connecting to a graphics card (instead of just a remote ac= cessible framebuffer), the X-in-a-jail patches are needed, as the X server n= eeds access to /dev/(k)mem and /dev/io (and /dev/drm). >=20 > ATTENTION: doing this compromises the complete security of the entire mach= ine. The jail with the X-server can then access the entire memory of the mac= hine, this means circumventing any kernel-level security protection / jail r= estrictions. >=20 > Using the PR_ALLOW_* flags from current in 11.1 is ok (sys/sys/jail.h): > ---snip--- > /* Flags for pr_allow */ > #define PR_ALLOW_SET_HOSTNAME 0x00000001 > #define PR_ALLOW_SYSVIPC 0x00000002 > #define PR_ALLOW_RAW_SOCKETS 0x00000004 > #define PR_ALLOW_CHFLAGS 0x00000008 > #define PR_ALLOW_MOUNT 0x00000010 > #define PR_ALLOW_QUOTAS 0x00000020 > #define PR_ALLOW_SOCKET_AF 0x00000040 > #define PR_ALLOW_MOUNT_DEVFS 0x00000080 > #define PR_ALLOW_MOUNT_NULLFS 0x00000100 > #define PR_ALLOW_MOUNT_ZFS 0x00000200 > #define PR_ALLOW_MOUNT_PROCFS 0x00000400 > #define PR_ALLOW_MOUNT_TMPFS 0x00000800 > #define PR_ALLOW_MOUNT_FDESCFS 0x00001000 > #define PR_ALLOW_MOUNT_LINPROCFS 0x00002000 > #define PR_ALLOW_MOUNT_LINSYSFS 0x00004000 > #define PR_ALLOW_RESERVED_PORTS 0x00008000 > #define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved, not u= sed yet */ > #define PR_ALLOW_ALL 0x0001ffff > ---snip--- >=20 > Then kern_jail.c needs a little patch: > ---snip--- > Index: sys/kern/kern_jail.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/kern/kern_jail.c (revision 321365) > +++ sys/kern/kern_jail.c (working copy) > @@ -200,6 +200,7 @@ > "allow.mount.linprocfs", > "allow.mount.linsysfs", > "allow.reserved_ports", > + "allow.kmem_access", > }; > const size_t pr_allow_names_size =3D sizeof(pr_allow_names); >=20 > @@ -220,6 +221,7 @@ > "allow.mount.nolinprocfs", > "allow.mount.nolinsysfs", > "allow.noreserved_ports", > + "allow.nokmem_access", > }; > const size_t pr_allow_nonames_size =3D sizeof(pr_allow_nonames); >=20 > @@ -3344,6 +3346,27 @@ > return (0); >=20 > /* > + * Allow access to /dev/io in a jail if the non-jailed adm= in > + * requests this and if /dev/io exists in the jail. This > + * allows Xorg to probe a card. > + */ > + case PRIV_IO: > + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) > + return (0); > + else > + return (EPERM); > + > + /* > + * Allow low level access to KMEM-like devices (e.g. to > + * allow Xorg to use DRI). > + */ > + case PRIV_KMEM_WRITE: > + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) > + return (0); > + else > + return (EPERM); > + > + /* > * Allow jailed root to set loginclass. > */ > case PRIV_PROC_SETLOGINCLASS: > ---snip--- >=20 > For 11.1 one little change is needed to get DRM access... see https://svnw= eb.freebsd.org/changeset/base/320827 >=20 > The jail then needs to be started with "allow.kmem_access" and appropriate= devfs rules (the jail needs rule 15 or 18, you may want to give more or les= s access, depending on your needs, review with care): > ---snip--- > [devfsrules_unhide_audio=3D5] > add path 'audio*' unhide > add path 'dsp*' unhide > add path midistat unhide > add path 'mixer*' unhide > add path 'music*' unhide > add path 'sequencer*' unhide > add path sndstat unhide > add path speaker unhide >=20 > [devfsrules_unhide_input=3D7] > add path 'atkbd*' unhide > add path 'kbd*' unhide > add path 'joy*' unhide > add path 'psm*' unhide > add path sysmouse unhide > add path 'ukbd*' unhide > add path 'ums*' unhide >=20 > [devfsrules_unhide_xorg=3D8] > add path agpgart unhide > #add path console unhide > add path dri unhide > add path 'dri/card*' unhide > add path nvidiactl unhide > add path 'nvidia*' unhide > add path io unhide > add path mem unhide > add path pci unhide > add path tty unhide > add path ttyv0 unhide > add path ttyv1 unhide > add path ttyv8 unhide >=20 > [devfsrules_unhide_kmem=3D11] > add path kmem unhide >=20 > [devfsrules_unhide_zfs=3D12] > add path zfs unhide >=20 > # > # This allows to run a desktop system in a jail. Think about what you wan= t to > # achieve before you use this, it opens up the entire machine to access fr= om > # this jail to any sophisticated program. > # > [devfsrules_jail_desktop=3D15] > add include $devfsrules_hide_all > add include $devfsrules_unhide_basic > add include $devfsrules_unhide_login > add include $devfsrules_unhide_audio > add include $devfsrules_unhide_input > add include $devfsrules_unhide_xorg > add include $devfsrules_unhide_kmem >=20 > [devfsrules_jail_desktop_withzfs=3D18] > add include $devfsrules_hide_all > add include $devfsrules_unhide_basic > add include $devfsrules_unhide_login > add include $devfsrules_unhide_audio > add include $devfsrules_unhide_input > add include $devfsrules_unhide_xorg > add include $devfsrules_unhide_kmem > add include $devfsrules_unhide_zfs > ---snip--- >=20 > Bye, > Alexander. >=20 > --=20 > http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF > http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF From owner-freebsd-hackers@freebsd.org Tue Sep 5 13:15:55 2017 Return-Path: Delivered-To: freebsd-hackers@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 1DA6EE08BDE for ; Tue, 5 Sep 2017 13:15:55 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:375::1:5]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C106692F for ; Tue, 5 Sep 2017 13:15:54 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Tue, 05 Sep 2017 15:15:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1504617352; bh=6ON49HgMVjasPWM8K+56Ftuz7EsvE7TBRQcvpb5GqXY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=O+iXNYVoAyRTHbJkpyZY8DRNzlXqvnl1j5tG/ZLLHCRfvFCgEDNegL4oBEO08hDG7 XfXWFWqLffFNWXzwtvslE/imeGOiwxu851R7lyjpA7cBpu04N/b57p8e3C8vkksfDy nE1hk6F8vWHk702UAfbOMqBoGECmCgNDJQ8BygNLe4yoDu0P7P3B9nPbQ123ZheLP6 p4tsj6u0yv1gkrRLmZd5/VKaXBDPj99A75LjYIzAnwjWTu7Wd5/BliWmJ/Bb4zTWFs 45tf0QMs1FS2/3UXGKROOVQrTyl1K+uA/80LMnI8fF6VKq5f8albFD2uFqutvUyuxV ebsw+OhG8IQiA== Message-ID: <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> From: Alexander Leidinger To: Giulio Ferro Cc: freebsd-hackers@freebsd.org Subject: Re: devd in jail References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> In-Reply-To: <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_j_T_Z2cPYedhdhN3hOXO19-"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 05 Sep 2017 13:51:18 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 13:15:55 -0000 This message is in MIME format and has been PGP signed. --=_j_T_Z2cPYedhdhN3hOXO19- Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Giulio Ferro (from Mon, 4 Sep 2017=20=20 08:51:10=20+0200): > On 10/08/2017 22:54, Alexander Leidinger wrote: >> >> Quoting Alan Somers (from Wed, 9 Aug 2017 >>> Unfortunately, you're not going to be able to run devd(8) in the jail. >>> /dev/devctl can be opened by only one reader at a time, and that >>> reader is always devd(8). /dev/devctl2 is actually a completely >>> different device with a totally different interface. Apologies for >>> the confusing names. But you may not need to run a totally separate >>> instance of devd. The X server is probably trying to open either >>> /var/run/devd.pipe or /var/run/devd.seqpacket.pipe. ktrace would tell >>> you which. If you can bridge those sockets into the jail, then X >>> would probably run. >> >> Apart from using an explicit config of devices instead of HAL /=20=20 >>=20devd, if this is a X server connecting to a graphics card (instead=20= =20 >>=20of just a remote accessible framebuffer), the X-in-a-jail patches=20= =20 >>=20are needed, as the X server needs access to /dev/(k)mem and /dev/io=20= =20 >>=20(and /dev/drm). >> > > Hi Alexander, > > as I said, I don't actually need to connect to any device, as this=20=20 >=20Xorg server in the jail only uses xrdp as backend. In this case you don't need my patches at all... I hope (my=20=20 understanding=20is that the X server needs this kind of access to access=20= =20 hardware).=20And to answer your question in another mail, yes, the diff=20= =20 is=20for current, not for 11.x. It's been a while since I looked last at the devd/hald <-> X11=20=20 interaction,=20but back then it was only needed to auto-detect=20=20 mouse/keyboard/...,=20so I wonder why xrdp needs it. Anyway, have a look=20= =20 to=20configure the config with static devices instead of devd/hald (see=20= =20 https://forums.freebsd.org/threads/7956/). Bye, Alexander. --=20 http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_j_T_Z2cPYedhdhN3hOXO19- Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJZrqN5AAoJEKrxQhqFIICEOf8QAIIwMkXO3f+Kx+KA2BY82DWH Be9lGNBKe+4keDmm5PAZE+OeyDvSlEsnYKhBZbjZPQNQ2Ta4N8uQRQ1xu39NODA7 0FiGhOaovijpXkdlzwlQvbLKCYJBfGK7YedkIugNUL1ZHLu0Pek6cIef/TakI3oP JoWJpKnnrYxtV7omf/7V84DjG89a9M8YAUbYhiqImDkDu2Mb74OcZwV6jP+q5GZd kDjeDItXkdyndq3GCGogGr3qqQ24+Wb0BxsXSpn9ccL7NXUC1rL1gtfwDk4JapIy 87aZN3VowQto60ARj7s3I8FRJ/Nn4Mb23GbYnnEhx1PyYaeeuxlryV+sUAkblDAy 7X7GjCGhXdGlkuPAeTSYswZ+MMbwLGFLWAf1txUCpRA2jjCPmId+Aaojndy59/JJ TQ4nWV+slLiIv4MilAxQeTX8tAHpfmYoCtDugiAkyBqPFOMUBfDDO1Cuh5Ebhyup GOmo6RqkX6yNGD6cEkJUqix+QKGUmnLhqLb8TH/djL8j6Gdwx8VyyugXSHmMWoBm 3uFSfy6T3WjeL0s4FGsl8EZGB6zFYQjDYAbvKyoH38l5rwgF/4VLeBXFX2MQT5jF ocZ84VuzIEhcyTRszEyRzjLHTVZuHNoU1v3oKmp4sn6qLSuzyIN01kU8Hz3Ob/T/ ed/dAhOLmAar5OCHu72x =rBe0 -----END PGP SIGNATURE----- --=_j_T_Z2cPYedhdhN3hOXO19--- From owner-freebsd-hackers@freebsd.org Tue Sep 5 18:25:26 2017 Return-Path: Delivered-To: freebsd-hackers@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 ADFDAE1721D for ; Tue, 5 Sep 2017 18:25:26 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id D417E63E63 for ; Tue, 5 Sep 2017 18:25:25 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 37B179D1A4; Tue, 5 Sep 2017 18:26:14 +0000 (UTC) Received: from [172.20.159.85] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 7BCEF9C944; Tue, 5 Sep 2017 18:26:13 +0000 (UTC) Subject: Re: devd in jail To: freebsd-hackers@freebsd.org, Alexander@leidinger.net References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> From: Giulio Ferro Message-ID: <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> Date: Tue, 5 Sep 2017 20:25:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 18:25:26 -0000 On 05/09/2017 15:15, Alexander Leidinger wrote: > > Quoting Giulio Ferro (from Mon, 4 Sep 2017 > 08:51:10 +0200): > >> On 10/08/2017 22:54, Alexander Leidinger wrote: >>> >>> Quoting Alan Somers (from Wed, 9 Aug 2017 > >>>> Unfortunately, you're not going to be able to run devd(8) in the jail. >>>> /dev/devctl can be opened by only one reader at a time, and that >>>> reader is always devd(8). /dev/devctl2 is actually a completely >>>> different device with a totally different interface. Apologies for >>>> the confusing names. But you may not need to run a totally separate >>>> instance of devd. The X server is probably trying to open either >>>> /var/run/devd.pipe or /var/run/devd.seqpacket.pipe. ktrace would tell >>>> you which. If you can bridge those sockets into the jail, then X >>>> would probably run. >>> >>> Apart from using an explicit config of devices instead of HAL / >>> devd, if this is a X server connecting to a graphics card (instead >>> of just a remote accessible framebuffer), the X-in-a-jail patches >>> are needed, as the X server needs access to /dev/(k)mem and /dev/io >>> (and /dev/drm). >>> >> >> Hi Alexander, >> >> as I said, I don't actually need to connect to any device, as this >> Xorg server in the jail only uses xrdp as backend. > > In this case you don't need my patches at all... I hope (my > understanding is that the X server needs this kind of access to access > hardware). And to answer your question in another mail, yes, the diff > is for current, not for 11.x. > > It's been a while since I looked last at the devd/hald <-> X11 > interaction, but back then it was only needed to auto-detect > mouse/keyboard/..., so I wonder why xrdp needs it. Anyway, have a look > to configure the config with static devices instead of devd/hald (see > https://forums.freebsd.org/threads/7956/). > > Bye, > Alexander. > Hi Alexander, and thanks for your reply. Actually I tried to apply the changes to xorg.conf, and now it doesn't try to access devd anymore. But it core-dumps for no apparent reason... Here is my /etc/X11/xrdp/xorg.conf. It is the one generated by xrdp plus the changes to the "ServerFlags" section specified in your link: ----------------------------------------------------------------------------------------------------------------------------------- Section "ServerLayout" Identifier "X11 Server" Screen "Screen (xrdpdev)" InputDevice "xrdpMouse" "CorePointer" InputDevice "xrdpKeyboard" "CoreKeyboard" EndSection Section "ServerFlags" Option "DontVTSwitch" "on" Option "DontZap" "off" Option "AllowEmptyInput" "off" Option "AutoAddDevices" "off" EndSection Section "Module" Load "dbe" Load "ddc" Load "extmod" Load "glx" Load "int10" Load "record" Load "vbe" Load "xorgxrdp" Load "fb" EndSection Section "InputDevice" Identifier "xrdpKeyboard" Driver "xrdpkeyb" EndSection Section "InputDevice" Identifier "xrdpMouse" Driver "xrdpmouse" EndSection Section "Monitor" Identifier "Monitor" Option "DPMS" HorizSync 30-80 VertRefresh 60-75 ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync EndSection Section "Device" Identifier "Video Card (xrdpdev)" Driver "xrdpdev" EndSection Section "Screen" Identifier "Screen (xrdpdev)" Device "Video Card (xrdpdev)" Monitor "Monitor" DefaultDepth 24 SubSection "Display" Depth 24 Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080" EndSubSection EndSection ----------------------------------------------------------------------------------------------------------------------------------- And here is my Xorg.log file: ----------------------------------------------------------------------------------------------------------------------------------- [ 796.772] X.Org X Server 1.18.4 Release Date: 2016-07-19 [ 796.772] X Protocol Version 11, Revision 0 [ 796.772] Build Operating System: FreeBSD 11.0-RELEASE-p12 amd64 [ 796.772] Current Operating System: FreeBSD xx.xx.xx 11.1-STABLE FreeBSD 11.1-STABLE #0: Thu Aug 31 11:52:30 UTC 2017 root@xx.xx.xx/usr/obj/usr/src/sys/MYKERN amd64 [ 796.772] Build Date: 29 August 2017 01:51:45AM [ 796.772] [ 796.772] Current version of pixman: 0.34.0 [ 796.772] Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. [ 796.772] Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 796.772] (==) Log file: "/var/log/Xorg.11.log", Time: Tue Sep 5 14:17:24 2017 [ 796.775] (++) Using config file: "/etc/X11/xrdp/xorg.conf" [ 796.775] (==) ServerLayout "X11 Server" [ 796.775] (**) |-->Screen "Screen (xrdpdev)" (0) [ 796.775] (**) | |-->Monitor "Monitor" [ 796.777] (**) | |-->Device "Video Card (xrdpdev)" [ 796.777] (**) |-->Input Device "xrdpMouse" [ 796.777] (**) |-->Input Device "xrdpKeyboard" [ 796.777] (**) Option "DontVTSwitch" "on" [ 796.777] (**) Option "DontZap" "off" [ 796.777] (**) Option "AutoAddDevices" "off" [ 796.777] (**) Not automatically adding devices [ 796.777] (==) Automatically enabling devices [ 796.777] (==) Not automatically adding GPU devices [ 796.777] (==) Max clients allowed: 256, resource mask: 0x1fffff [ 796.787] (==) FontPath set to: /usr/local/share/fonts/misc/, /usr/local/share/fonts/TTF/, /usr/local/share/fonts/OTF/, /usr/local/share/fonts/Type1/, /usr/local/share/fonts/100dpi/, /usr/local/share/fonts/75dpi/ [ 796.787] (==) ModulePath set to "/usr/local/lib/xorg/modules" [ 796.789] (II) Loader magic: 0x813b70 [ 796.789] (II) Module ABI versions: [ 796.789] X.Org ANSI C Emulation: 0.4 [ 796.789] X.Org Video Driver: 20.0 [ 796.789] X.Org XInput driver : 22.1 [ 796.789] X.Org Server Extension : 9.0 [ 796.789] (WW) checkDevMem: failed to open /dev/mem (Operation not permitted) [ 796.789] (--) PCI:*(0:0:2:0) 1013:00b8:5853:0001 rev 0, Mem @ 0xf0000000/33554432, 0xf3000000/4096, BIOS @ 0x????????/65536 [ 796.789] (II) "glx" will be loaded. This was enabled by default and also specified in the config file. [ 796.789] (II) LoadModule: "dbe" [ 796.789] (II) Module "dbe" already built-in [ 796.789] (II) LoadModule: "ddc" [ 796.789] (II) Module "ddc" already built-in [ 796.789] (II) LoadModule: "extmod" [ 796.789] (II) Module "extmod" already built-in [ 796.789] (II) LoadModule: "glx" [ 796.792] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so [ 796.821] (II) Module glx: vendor="X.Org Foundation" [ 796.821] compiled for 1.18.4, module version = 1.0.0 [ 796.821] ABI class: X.Org Server Extension, version 9.0 [ 796.821] (==) AIGLX enabled [ 796.822] (II) LoadModule: "int10" [ 796.823] (II) Loading /usr/local/lib/xorg/modules/libint10.so [ 796.825] (II) Module int10: vendor="X.Org Foundation" [ 796.825] compiled for 1.18.4, module version = 1.0.0 [ 796.825] ABI class: X.Org Video Driver, version 20.0 [ 796.825] (II) LoadModule: "record" [ 796.825] (II) Module "record" already built-in [ 796.825] (II) LoadModule: "vbe" [ 796.826] (II) Loading /usr/local/lib/xorg/modules/libvbe.so [ 796.827] (II) Module vbe: vendor="X.Org Foundation" [ 796.827] compiled for 1.18.4, module version = 1.1.0 [ 796.827] ABI class: X.Org Video Driver, version 20.0 [ 796.827] (II) LoadModule: "xorgxrdp" [ 796.828] (II) Loading /usr/local/lib/xorg/modules/libxorgxrdp.so [ 796.832] (II) Module XORGXRDP: vendor="X.Org Foundation" [ 796.832] compiled for 1.18.4, module version = 1.0.0 [ 796.832] ABI class: X.Org Video Driver, version 20.0 [ 796.832] xorgxrdpSetup: [ 796.832] (II) LoadModule: "fb" [ 796.832] (II) Loading /usr/local/lib/xorg/modules/libfb.so [ 796.835] (II) Module fb: vendor="X.Org Foundation" [ 796.835] compiled for 1.18.4, module version = 1.0.0 [ 796.835] ABI class: X.Org ANSI C Emulation, version 0.4 [ 796.835] (II) LoadModule: "xrdpdev" [ 796.835] (II) Loading /usr/local/lib/xorg/modules/drivers/xrdpdev_drv.so [ 796.837] (II) Module XRDPDEV: vendor="X.Org Foundation" [ 796.837] compiled for 1.18.4, module version = 1.0.0 [ 796.837] ABI class: X.Org Video Driver, version 20.0 [ 796.837] xrdpdevSetup: [ 796.837] (II) LoadModule: "xrdpmouse" [ 796.837] (II) Loading /usr/local/lib/xorg/modules/input/xrdpmouse_drv.so [ 796.838] (II) Module XRDPMOUSE: vendor="X.Org Foundation" [ 796.838] compiled for 1.18.4, module version = 1.0.0 [ 796.838] Module class: X.Org XInput Driver [ 796.838] ABI class: X.Org XInput driver, version 22.1 [ 796.838] rdpmousePlug: [ 796.838] (II) LoadModule: "xrdpkeyb" [ 796.838] (II) Loading /usr/local/lib/xorg/modules/input/xrdpkeyb_drv.so [ 796.839] (II) Module XRDPKEYB: vendor="X.Org Foundation" [ 796.839] compiled for 1.18.4, module version = 1.0.0 [ 796.839] Module class: X.Org XInput Driver [ 796.839] ABI class: X.Org XInput driver, version 22.1 [ 796.839] rdpkeybPlug: [ 796.839] rdpIdentify: [ 796.839] (II) XRDPDEV: driver for xrdp: XRDPDEV [ 796.839] rdpDriverFunc: op 10 [ 796.839] (WW) Falling back to old probe method for XRDPDEV [ 796.839] rdpProbe: [ 796.839] (II) Loading sub module "fb" [ 796.839] (II) LoadModule: "fb" [ 796.839] (II) Loading /usr/local/lib/xorg/modules/libfb.so [ 796.839] (II) Module fb: vendor="X.Org Foundation" [ 796.839] compiled for 1.18.4, module version = 1.0.0 [ 796.839] ABI class: X.Org ANSI C Emulation, version 0.4 [ 796.839] (II) XRDPDEV(0): using default device [ 796.839] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support [ 796.839] rdpPreInit: [ 796.839] (**) XRDPDEV(0): Depth 24, (--) framebuffer bpp 32 [ 796.839] (==) XRDPDEV(0): RGB weight 888 [ 796.839] (==) XRDPDEV(0): Using gamma correction (1.0, 1.0, 1.0) [ 796.839] (==) XRDPDEV(0): Default visual is TrueColor [ 796.839] (==) XRDPDEV(0): DPI set to (96, 96) [ 796.839] (II) XRDPDEV(0): mode "640x480" ok [ 796.839] (II) XRDPDEV(0): mode "800x600" ok [ 796.839] (--) XRDPDEV(0): Virtual size is 800x600 (pitch 800) [ 796.839] (**) XRDPDEV(0): Default mode "800x600": 36.0 MHz (scaled from 0.0 MHz), 35.2 kHz, 56.2 Hz [ 796.839] (II) XRDPDEV(0): Modeline "800x600"x0.0 36.00 800 824 896 1024 600 601 603 625 +hsync +vsync (35.2 kHz d) [ 796.839] (==) Depth 24 pixmap format is 32 bpp [ 796.841] rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24 [ 796.841] rdpScreenInit: pfbMemory bytes 1920000 [ 796.841] rdpScreenInit: pfbMemory 0x807200000 [ 796.843] rdpSimdInit: assigning yuv functions [ 796.843] rdpSimdInit: cpuid ax 1 cx 0 return ax 0x000306f2 bx 0x00020800 cx 0xfffa3203 dx 0x178bfbff [ 796.843] rdpSimdInit: sse2 amd64 yuv functions assigned [ 796.843] rdpXvInit: depth 24 [ 796.845] (==) XRDPDEV(0): Backing store enabled [ 796.845] rdpClientConInit: kill disconnected [0] timeout [0] sec [ 796.845] [ 796.845] rdpScreenInit: out [ 796.846] (==) RandR enabled [ 796.846] MIT-SHM extension disabled due to lack of kernel support [ 796.852] (II) AIGLX: Screen 0 is not DRI2 capable [ 796.852] (EE) AIGLX: reverting to software rendering [ 797.431] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer [ 797.431] (II) AIGLX: Loaded and initialized swrast [ 797.431] (II) GLX: Initialized DRISWRAST GL provider for screen 0 [ 797.545] (II) Using input driver 'XRDPMOUSE' for 'xrdpMouse' [ 797.545] (**) Option "CorePointer" [ 797.545] (**) xrdpMouse: always reports core events [ 797.545] rdpmousePreInit: drv 0x803c15240 info 0x80ce72e20, flags 0x0 [ 797.545] (II) XINPUT: Adding extended input device "xrdpMouse" (type: Mouse, id 6) [ 797.545] rdpmouseControl: what 0 [ 797.545] rdpmouseDeviceInit: [ 797.545] rdpmouseCtrl: [ 797.545] rdpRegisterInputCallback: type 1 proc 0x806da1d20 [ 797.545] (**) xrdpMouse: (accel) keeping acceleration scheme 1 [ 797.545] (**) xrdpMouse: (accel) acceleration profile 0 [ 797.545] (**) xrdpMouse: (accel) acceleration factor: 2.000 [ 797.545] (**) xrdpMouse: (accel) acceleration threshold: 4 [ 797.545] rdpmouseControl: what 1 [ 797.545] rdpmouseDeviceOn: [ 797.545] (II) Using input driver 'XRDPKEYB' for 'xrdpKeyboard' [ 797.545] (**) Option "CoreKeyboard" [ 797.545] (**) xrdpKeyboard: always reports core events [ 797.545] rdpkeybPreInit: drv 0x803c152c0 info 0x80ce72f60, flags 0x0 [ 797.545] (II) XINPUT: Adding extended input device "xrdpKeyboard" (type: Keyboard, id 7) [ 797.545] rdpkeybControl: what 0 [ 797.545] rdpkeybDeviceInit: [ 797.568] rdpkeybChangeKeyboardControl: [ 797.568] rdpkeybChangeKeyboardControl: autoRepeat on [ 797.568] rdpRegisterInputCallback: type 0 proc 0x806fa41b0 [ 797.568] rdpkeybControl: what 1 [ 797.568] rdpkeybDeviceOn: [ 797.568] (II) config/devd: probing input devices... [ 797.568] (II) config/devd: adding input device (null) (/dev/kbdmux) [ 797.568] (II) AutoAddDevices is off - not adding device. [ 797.568] (II) config/devd: kbdmux is enabled, ignoring device atkbd0 [ 797.568] (II) config/devd: adding input device (null) (/dev/sysmouse) [ 797.568] (II) AutoAddDevices is off - not adding device. [ 797.601] (II) config/devd: adding input device Mouse (/dev/psm0) [ 797.601] (II) AutoAddDevices is off - not adding device. [ 797.601] (EE) config/devd: fail to connect to devd [ 797.601] [config] failed to initialise devd [ 797.602] rdpSaveScreen: [ 797.602] rdpClientConGotConnection: [ 797.602] rdpClientConGotConnection: g_sck_accept ok new_sck 5 [ 797.602] rdpClientConGotConnection: adding only clientCon [ 797.602] rdpDeferredRandR: [ 797.602] rdpResizeSession: width 1024 height 768 [ 797.602] calling RRScreenSizeSet [ 797.602] rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203 [ 797.602] rdpRRGetInfo: [ 797.602] screen resized to 1024x768 [ 797.604] RRScreenSizeSet ok 1 [ 797.604] rdpResizeSession: width 1244 height 509 [ 797.604] calling RRScreenSizeSet [ 797.604] rdpRRScreenSetSize: width 1244 height 509 mmWidth 329 mmHeight 135 [ 797.604] rdpRRGetInfo: [ 797.604] screen resized to 1244x509 [ 797.605] RRScreenSizeSet ok 1 [ 797.605] rdpClientConProcessMsgVersion: version 0 0 0 1 [ 797.605] rdpClientConProcessScreenSizeMsg: set width 1244 height 509 bpp 16 [ 797.605] rdpClientConProcessScreenSizeMsg: shmemid -1 shmemptr 0xffffffffffffffff [ 797.605] rdpClientConProcessMsgClientInput: invalidate x 0 y 0 cx 1244 cy 509 [ 797.668] rdpInDeferredUpdateCallback: [ 797.668] rdpkeybChangeKeyboardControl: [ 797.668] rdpkeybChangeKeyboardControl: autoRepeat off [ 813.899] rdpClientConProcessMsgClientInfo: [ 813.899] got client info bytes 5744 [ 813.899] jpeg support 0 [ 813.899] offscreen support 0 [ 813.899] offscreen size 0 [ 813.899] offscreen entries 0 [ 813.899] client supports glyph cache but server disabled [ 813.899] client can not do offscreen to offscreen blits [ 813.899] client can do new(color) cursor [ 813.899] client can not do multimon [ 813.899] rdpRRSetRdpOutputs: numCrtcs 0 monitorCount 0 [ 813.899] rdpRRSetRdpOutputs: add output 0 left 0 top 0 width 1244 height 509 [ 813.900] rdpLoadLayout: keylayout 0x00000409 variant display 11 [ 813.900] rdpkeybChangeKeyboardControl: [ 813.900] rdpkeybChangeKeyboardControl: autoRepeat on [ 813.900] rdpkeybChangeKeyboardControl: [ 813.900] rdpkeybChangeKeyboardControl: autoRepeat on [ 813.910] (EE) [ 813.910] (EE) Backtrace: [ 813.912] (EE) 0: /usr/local/bin/Xorg (OsInit+0x38a) [0x5abfba] [ 813.914] (EE) 1: /lib/libthr.so.3 (_pthread_sigmask+0x544) [0x8025cbd94] [ 813.915] (EE) 2: /lib/libthr.so.3 (_pthread_getspecific+0xe5f) [0x8025cbbef] [ 813.916] (EE) 3: ? (?+0xe5f) [0x7ffffffffe62] [ 813.918] (EE) 4: /usr/local/lib/xorg/modules/libxorgxrdp.so (rdpCapture+0xf60) [0x806771aa0] [ 813.919] (EE) 5: /usr/local/lib/xorg/modules/libxorgxrdp.so (rdpClientConAddAllBox+0x408) [0x80676fbf8] [ 813.920] (EE) 6: /usr/local/lib/xorg/modules/libxorgxrdp.so (rdpClientConAddDirtyScreenReg+0x3c3) [0x80676ef13] [ 813.921] (EE) 7: /usr/local/bin/Xorg (WaitForSomething+0x103e) [0x5a47ce] [ 813.922] (EE) 8: /usr/local/bin/Xorg (UpdateCurrentTimeIf+0x121) [0x431621] [ 813.923] (EE) 9: /usr/local/bin/Xorg (remove_fs_handlers+0x597) [0x43b697] [ 813.924] (EE) 10: /usr/local/bin/Xorg (_start+0x17f) [0x42506f] [ 813.925] (EE) 11: ? (?+0x17f) [0x80083617f] [ 813.925] (EE) [ 813.925] (EE) Segmentation fault at address 0xffffffffffffffff [ 813.925] (EE) Fatal server error: [ 813.925] (EE) Caught signal 11 (Segmentation fault). Server aborting [ 813.925] (EE) [ 813.925] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 813.925] (EE) Please also check the log file at "/var/log/Xorg.11.log" for additional information. [ 813.925] (EE) [ 813.925] rdpmouseControl: what 4 [ 813.925] rdpkeybControl: what 4 [ 813.925] rdpLeaveVT: [ 813.925] (EE) Server terminated with error (1). Closing log file. ----------------------------------------------------------------------------------------------------------------------------------- I have a custom kernel which include GENERIC and only the VIMAGE + bridge support is added. Can you make something of it? Or do you have any suggestions about what I could try? Thanks in advance! Giulio From owner-freebsd-hackers@freebsd.org Tue Sep 5 18:35:10 2017 Return-Path: Delivered-To: freebsd-hackers@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 4D161E17CCC for ; Tue, 5 Sep 2017 18:35:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-93.reflexion.net [208.70.210.93]) (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 86E85663B0 for ; Tue, 5 Sep 2017 18:35:08 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 25623 invoked from network); 5 Sep 2017 18:36:57 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 5 Sep 2017 18:36:57 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Tue, 05 Sep 2017 14:35:02 -0400 (EDT) Received: (qmail 17339 invoked from network); 5 Sep 2017 18:35:02 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 5 Sep 2017 18:35:02 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id AE173EC950D; Tue, 5 Sep 2017 11:35:01 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: devd in jail From: Mark Millard In-Reply-To: <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> Date: Tue, 5 Sep 2017 11:35:00 -0700 Cc: freebsd-hackers@freebsd.org, Alexander@leidinger.net Content-Transfer-Encoding: quoted-printable Message-Id: <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> To: Giulio Ferro X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 18:35:10 -0000 [I've no particular expertise but I noticed in what you reported . . .] On 2017-Sep-5, at 11:25 AM, Giulio Ferro = wrote: > . . . >=20 > Actually I tried to apply the changes to xorg.conf, and now it doesn't = try to access devd anymore. >=20 > . . . > [ 797.601] (EE) config/devd: fail to connect to devd > . . . I expect that the "(EE)" indicates an error is being reported and so it is intended as more than an informational notice. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-hackers@freebsd.org Tue Sep 5 18:41:46 2017 Return-Path: Delivered-To: freebsd-hackers@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 E7B5EE18360 for ; Tue, 5 Sep 2017 18:41:46 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2A667D9D for ; Tue, 5 Sep 2017 18:41:46 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 836A79D1A4 for ; Tue, 5 Sep 2017 18:42:35 +0000 (UTC) Received: from [172.20.159.85] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 2A1549C944 for ; Tue, 5 Sep 2017 18:42:35 +0000 (UTC) Subject: Re: devd in jail To: freebsd-hackers@freebsd.org References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> From: Giulio Ferro Message-ID: Date: Tue, 5 Sep 2017 20:41:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 18:41:47 -0000 On 05/09/2017 20:35, Mark Millard wrote: > [I've no particular expertise but I noticed in what you > reported . . .] > > On 2017-Sep-5, at 11:25 AM, Giulio Ferro wrote: > >> . . . >> >> Actually I tried to apply the changes to xorg.conf, and now it doesn't try to access devd anymore. >> >> . . . >> [ 797.601] (EE) config/devd: fail to connect to devd >> . . . > I expect that the "(EE)" indicates an error is being reported > and so it is intended as more than an informational notice. > Hi Mark, yes, I missed that! Thanks for raising. Then I guess it's the same error as occurred before. It seems that xorg can't help trying to access devd and so it fails in jail... Giulio From owner-freebsd-hackers@freebsd.org Wed Sep 6 10:26:38 2017 Return-Path: Delivered-To: freebsd-hackers@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 8F5EEE1F815 for ; Wed, 6 Sep 2017 10:26:38 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:375::1:5]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1180E74BAD for ; Wed, 6 Sep 2017 10:26:38 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Wed, 06 Sep 2017 12:25:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1504693587; bh=QGGFA65oN0gv5qQzJFo9Rh1Lz8BAujM1IXANMXJY8N8=; h=Date:From:To:Subject:References:In-Reply-To; b=dwT+B3pU90cfrqzXUBYJxiKUbZu0XWDfasyFbR7TCDD/PttUtdZoRcE3F9tZGKV8z aJAVXYKIyurnzz0cvlAg268QQCk5ovqrXbE4L2BFXziunHgNRNX49/+/5JwG7ChSGY wB7JrHPJn2ycH/G9HCxICCLSAcOYq1OuQTZPOaQdNtfpJzl+ZVupphReroYaB6/Vlc K8fsgIR08e6wRbnEZoTcebzJAFJSL2YyKAckFVdUBIqnxNcV/v75Mw+Jgs/A+F0AVC /IZ76xRgSM3mwzQPsbyVXFNh43SZke2kXSGGILnJqW/4o8EwRdJqg6Ihes0qNVbDUo FmC9CfBRnKexw== Message-ID: <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> From: Alexander Leidinger To: freebsd-hackers@freebsd.org Subject: Re: devd in jail References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> In-Reply-To: User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_g3W4OfyHMxuyTSrtOWQs4Qq"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 06 Sep 2017 10:40:33 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 10:26:38 -0000 This message is in MIME format and has been PGP signed. --=_g3W4OfyHMxuyTSrtOWQs4Qq Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Giulio Ferro (from Tue, 5 Sep 2017=20=20 20:41:41=20+0200): > On 05/09/2017 20:35, Mark Millard wrote: >> [I've no particular expertise but I noticed in what you >> reported . . .] >> >> On 2017-Sep-5, at 11:25 AM, Giulio Ferro wrote= : >> >>> . . . >>> >>> Actually I tried to apply the changes to xorg.conf, and now it=20=20 >>>=20doesn't try to access devd anymore. >>> >>> . . . >>> [ 797.601] (EE) config/devd: fail to connect to devd >>> . . . >> I expect that the "(EE)" indicates an error is being reported >> and so it is intended as more than an informational notice. >> > > > Hi Mark, > > yes, I missed that! Thanks for raising. > > Then I guess it's the same error as occurred before. > > It seems that xorg can't help trying to access devd and so it fails=20=20 >=20in jail... There are several EE entries in the log. [ 796.846] MIT-SHM extension disabled due to lack of kernel support [ 796.852] (II) AIGLX: Screen 0 is not DRI2 capable [ 796.852] (EE) AIGLX: reverting to software rendering [ 797.431] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer I don't expect this to be critical. Not sure about the devd one. The segmentation fault is for sure an issue which prevents it from=20=20 working,=20but I don't know if this is related to one of the EE above or=20= =20 not.=20You would have to check in the X.org / xrdp area for help (or if=20= =20 you=20have updated some pieces like OS/jail/kernel/ports since you have=20= =20 installed=20xrdp, you could try a fresh install of everything to=20=20 rule-out=20some inconsistencies which could show up in some edge-cases). Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_g3W4OfyHMxuyTSrtOWQs4Qq Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJZr800AAoJEKrxQhqFIICEXwUP/1rbDltfxcwxzyOMdSwe8tcz bRPeXdBxx0kHT+IZItBfn/lNGLDJZvvPobC6pFYoa2klUIEXU3oOVBY6BCFBcW3J liO76x0kkUZe+3YXjCSP/nvBYK4/SotSA+i+tvmGiyn1dxmZbBoukbS6NTHhKkZf r68NXEYT3208Ik+zvgeEjoryoKblm1gtWMz0sW7wArqF02poa/F/15awrwdw65lB sCriCeUphIXtnKRisvQVK0P3OHf8nz2ECHkcrKW7nWGDS9tCUErtbMHXq+reLCev yoWeR80i1LGertQ80qbEivN1ly4qJ6jKPP4kIK+HO0aGba84LZcBlFz9qCbuuojn u9TTnt8jeyzGr6dluA2+PPM9197xmUhIWLtXbCSmEV2ML+FbRt6RPfD1DZ+wR70t 7BJak9w7lPmfaYcbgTZgnK0KqtDAVXASGHQQEmsXeLSOpxZFTCnFdhLsAwJdQrlw lYsgGdfYWTcXZhc813IjPT1RMeNJAc4ZWtdTkLu8FxUvSom62q+p/WDImNAzkiQB B6DirD7W/hCrqj0FkQ/2Fyz3rcxSz2efV77euUBehb1PH0ybjfewpG/02Y+PZCOt djVN8ihIdDGFhCHVci9xMJObTifzLSjvJk3wZJd1fAMPwCFZVd54sz27H9dOchL0 nNM4A07G71QHyJAIY6zX =uwsC -----END PGP SIGNATURE----- --=_g3W4OfyHMxuyTSrtOWQs4Qq-- From owner-freebsd-hackers@freebsd.org Wed Sep 6 12:13:56 2017 Return-Path: Delivered-To: freebsd-hackers@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 ABFC1E004FC for ; Wed, 6 Sep 2017 12:13:56 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 56AC16C140 for ; Wed, 6 Sep 2017 12:13:55 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id F0BB89D1A6; Wed, 6 Sep 2017 12:14:44 +0000 (UTC) Received: from [192.168.43.15] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id C0F7B9D1A5; Wed, 6 Sep 2017 12:14:44 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: devd in jail From: Giulio Ferro X-Mailer: iPhone Mail (14G60) In-Reply-To: <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> Date: Wed, 6 Sep 2017 14:13:52 +0200 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> To: Alexander Leidinger X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 12:13:56 -0000 Hi Alexander, I've installed everything after my custom kernel was installed. And as I sai= d, it differs from GENERIC only for the addition of VIMAGE and bridge. What I can try to do is installing your patches so to remove the devd issue,= and see if it starts like this. Can you point me to patches for 11.1 stable? Thanks=20 Giulio=20 > Il giorno 06 set 2017, alle ore 12:25, Alexander Leidinger ha scritto: >=20 > Quoting Giulio Ferro (from Tue, 5 Sep 2017 20:41:41= +0200): >=20 >>> On 05/09/2017 20:35, Mark Millard wrote: >>> [I've no particular expertise but I noticed in what you >>> reported . . .] >>>=20 >>>> On 2017-Sep-5, at 11:25 AM, Giulio Ferro wrot= e: >>>>=20 >>>> . . . >>>>=20 >>>> Actually I tried to apply the changes to xorg.conf, and now it doesn't t= ry to access devd anymore. >>>>=20 >>>> . . . >>>> [ 797.601] (EE) config/devd: fail to connect to devd >>>> . . . >>> I expect that the "(EE)" indicates an error is being reported >>> and so it is intended as more than an informational notice. >>>=20 >>=20 >>=20 >> Hi Mark, >>=20 >> yes, I missed that! Thanks for raising. >>=20 >> Then I guess it's the same error as occurred before. >>=20 >> It seems that xorg can't help trying to access devd and so it fails in ja= il... >=20 > There are several EE entries in the log. >=20 > [ 796.846] MIT-SHM extension disabled due to lack of kernel support > [ 796.852] (II) AIGLX: Screen 0 is not DRI2 capable > [ 796.852] (EE) AIGLX: reverting to software rendering > [ 797.431] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer >=20 > I don't expect this to be critical. >=20 > Not sure about the devd one. > The segmentation fault is for sure an issue which prevents it from working= , but I don't know if this is related to one of the EE above or not. You wou= ld have to check in the X.org / xrdp area for help (or if you have updated s= ome pieces like OS/jail/kernel/ports since you have installed xrdp, you coul= d try a fresh install of everything to rule-out some inconsistencies which c= ould show up in some edge-cases). >=20 > Bye, > Alexander. >=20 > --=20 > http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF > http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF From owner-freebsd-hackers@freebsd.org Wed Sep 6 20:20:15 2017 Return-Path: Delivered-To: freebsd-hackers@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 1C15BE1513A for ; Wed, 6 Sep 2017 20:20:15 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9068475BCC for ; Wed, 6 Sep 2017 20:20:13 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Wed, 06 Sep 2017 22:19:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1504729209; bh=gWM3CCgJlw/BhvnfcPFiwGhn9pzYIkavqlkorlS011M=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=rCJbD4F32Afywbd2xY7GFhg8BeBiHJNbOeyOcvpzWxnP0UsksjdEBDLPeNlbHjxX0 nCd7dUI3VgTr7ZxoJVoOU8WJAsiuhR1l6vaqa7ibK9m3nOlz10hX+D28FRPvrDQCig 7ju3LPJHt1yo4uAGCCDqc+ASOdJmmyFPSGiwi8jEfNSEtQ9WKwuLzJyOPVvk40IFOp 5brxSbwtU7a3WkI8gPrnoG+BZ5sG3xfhZM55StqhQ0PYbo+EM/NXB0xbcJXcrcZtDM bNZPFGpgfLUUqaGGB9yyeFuhtEhKHYXqtyFGhKyLlg/ZNbaHFQYc2nt/Do7W1KBvaQ MA4IXCNq7aWEg== Message-ID: <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> From: Alexander Leidinger To: Giulio Ferro Cc: freebsd-hackers@freebsd.org Subject: Re: devd in jail References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> In-Reply-To: User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_ftI2LZ5H-mMGjTwCMPldQ0D"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 06 Sep 2017 21:43:42 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 20:20:15 -0000 This message is in MIME format and has been PGP signed. --=_ftI2LZ5H-mMGjTwCMPldQ0D Content-Type: multipart/mixed; boundary="=_cvyxBqX5U1UWLjXD9L-9SOS" This message is in MIME format. --=_cvyxBqX5U1UWLjXD9L-9SOS Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Giulio Ferro (from Wed, 6 Sep 2017=20=20 14:13:52=20+0200): > Hi Alexander, > > I've installed everything after my custom kernel was installed. And=20=20 >=20as I said, it differs from GENERIC only for the addition of VIMAGE=20= =20 >=20and bridge. > > What I can try to do is installing your patches so to remove the=20=20 >=20devd issue, and see if it starts like this. > > Can you point me to patches for 11.1 stable? Attached, patch against releng-11.1. Beware, this is not even=20=20 compile-tested.=20And you need the modifications described in a previous=20= =20 mail=20for /etc/devfs.rules. Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_cvyxBqX5U1UWLjXD9L-9SOS Content-Type: text/x-diff; name=x11_in_jail__releng_11_1.diff Content-Disposition: attachment; size=3579; filename=x11_in_jail__releng_11_1.diff Content-Transfer-Encoding: quoted-printable Index: sys/dev/drm/drmP.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/drm/drmP.h (Revision 323230) +++ sys/dev/drm/drmP.h (Arbeitskopie) @@ -219,7 +219,7 @@ =20 =20#define PAGE_ALIGN(addr) round_page(addr) /* DRM_SUSER returns true if the user is superuser */ -#define DRM_SUSER(p) (priv_check(p, PRIV_DRIVER) =3D=3D 0) +#define DRM_SUSER(p) (priv_check(p, PRIV_KMEM_WRITE) =3D=3D 0) #define DRM_AGP_FIND_DEVICE() agp_find_device() #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks Index: sys/kern/kern_jail.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/kern/kern_jail.c (Revision 323230) +++ sys/kern/kern_jail.c (Arbeitskopie) @@ -199,6 +199,7 @@ "allow.mount.fdescfs", "allow.mount.linprocfs", "allow.mount.linsysfs", + "allow.kmem_access", }; const size_t pr_allow_names_size =3D sizeof(pr_allow_names); =20 @@=20-218,6 +219,7 @@ "allow.mount.nofdescfs", "allow.mount.nolinprocfs", "allow.mount.nolinsysfs", + "allow.nokmem_access", }; const size_t pr_allow_nonames_size =3D sizeof(pr_allow_nonames); =20 @@=20-3334,6 +3336,22 @@ case PRIV_NETINET_GETCRED: return (0); =20 +=09case PRIV_IO: + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) + return (0); + else + return (EPERM); + + /* + * Allow low level access to KMEM-like devices (e.g. to + * allow Xorg to use DRI). + */ + case PRIV_KMEM_WRITE: + if (cred->cr_prison->pr_allow & PR_ALLOW_KMEM_ACCESS) + return (0); + else + return (EPERM); + /* * Allow jailed root to set loginclass. */ Index: sys/sys/jail.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/jail.h (Revision 323230) +++ sys/sys/jail.h (Arbeitskopie) @@ -215,22 +215,24 @@ /* by this jail or an ancestor */ =20 =20/* Flags for pr_allow */ -#define PR_ALLOW_SET_HOSTNAME 0x0001 -#define PR_ALLOW_SYSVIPC 0x0002 -#define PR_ALLOW_RAW_SOCKETS 0x0004 -#define PR_ALLOW_CHFLAGS 0x0008 -#define PR_ALLOW_MOUNT 0x0010 -#define PR_ALLOW_QUOTAS 0x0020 -#define PR_ALLOW_SOCKET_AF 0x0040 -#define PR_ALLOW_MOUNT_DEVFS 0x0080 -#define PR_ALLOW_MOUNT_NULLFS 0x0100 -#define PR_ALLOW_MOUNT_ZFS 0x0200 -#define PR_ALLOW_MOUNT_PROCFS 0x0400 -#define PR_ALLOW_MOUNT_TMPFS 0x0800 -#define PR_ALLOW_MOUNT_FDESCFS 0x1000 -#define PR_ALLOW_MOUNT_LINPROCFS 0x2000 -#define PR_ALLOW_MOUNT_LINSYSFS 0x4000 -#define PR_ALLOW_ALL 0x7fff +#define PR_ALLOW_SET_HOSTNAME 0x00000001 +#define PR_ALLOW_SYSVIPC 0x00000002 +#define PR_ALLOW_RAW_SOCKETS 0x00000004 +#define PR_ALLOW_CHFLAGS 0x00000008 +#define PR_ALLOW_MOUNT 0x00000010 +#define PR_ALLOW_QUOTAS 0x00000020 +#define PR_ALLOW_SOCKET_AF 0x00000040 +#define PR_ALLOW_MOUNT_DEVFS 0x00000080 +#define PR_ALLOW_MOUNT_NULLFS 0x00000100 +#define PR_ALLOW_MOUNT_ZFS 0x00000200 +#define PR_ALLOW_MOUNT_PROCFS 0x00000400 +#define PR_ALLOW_MOUNT_TMPFS 0x00000800 +#define PR_ALLOW_MOUNT_FDESCFS 0x00001000 +#define PR_ALLOW_MOUNT_LINPROCFS 0x00002000 +#define PR_ALLOW_MOUNT_LINSYSFS 0x00004000 +#define PR_ALLOW_RESERVED_PORTS 0x00008000 +#define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved= , not used yet */ +#define PR_ALLOW_ALL 0x0001ffff =20 =20/* * OSD methods --=_cvyxBqX5U1UWLjXD9L-9SOS-- --=_ftI2LZ5H-mMGjTwCMPldQ0D Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJZsFhjAAoJEKrxQhqFIICENZ4P/19RnVfMpy8NgXDJBn6+IHKF /4uYVoSSR8M/o31cEDYjUnFmH7ajM9fpXWvfNKgE5mLKJgokew60Yn9iYVzIMCm6 MpxQ+H/8XwQtnN+bN9KOWxE+QyCUf6D5ZD2bMlzezzQxv08wM5HQd763Hw9F5ExR unN8HzvuZYF75xjFOq0+tX8F5g22F0cHwHnYMkKrdEODMmwBDLbIR2caKDgNnSj6 XdramhfpNhTm5UTvs1n0x94Lo6x0m1lirHiagyUMHAPz9bpd8Lbc/pFySwffUrh0 JFZOg7zqXBQDjqg4yRrdXNSwIdcq85SUOVojt+TU0U0ecDvIABx6igzkWs8X55mK WyMGiofPe0bA3G/W41k5NQ7gcmvD8KfQaSI6I10hH2Yq97Gpe4LRIqkNyYR6nYGo qfYKfYxVkItsYDNpEbseMH/AA3BjecqWm9jra7kEcWJ2RvKubULKk/a21Spr1vXn 9V8Hlw7pz428Hhddh95YOteqHfmV7j1u8NWq16OPcsr4yDKsS/xFsoeB6A53Bbu2 HpQSvcWA5vIDDO/IPwMl23lQiiBlxQ7yAmLYqdFQb+LJ66Fd+NCW0w8uKe6AZLI5 liyr6faFmZmieXPBhl7s2T4XlaIKT8cnjdrPAdChNXC9CqHMb3LWM2uSFVKJnkNK F1U5rTgUFONayYssx5PX =RcPB -----END PGP SIGNATURE----- --=_ftI2LZ5H-mMGjTwCMPldQ0D-- From owner-freebsd-hackers@freebsd.org Thu Sep 7 06:49:59 2017 Return-Path: Delivered-To: freebsd-hackers@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 66197E0B896 for ; Thu, 7 Sep 2017 06:49:59 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BF96D7EF2D for ; Thu, 7 Sep 2017 06:49:58 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [192.168.59.242] ([61.141.64.170]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v876nX2b094038 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 7 Sep 2017 06:49:34 GMT (envelope-from by@meetlost.com) From: by Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Thu, 7 Sep 2017 14:49:54 +0800 Subject: Parse command line arguments with getopt_long() Message-Id: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: freebsd-hackers@freebsd.org X-Mailer: iPhone Mail (14G60) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 06:49:59 -0000 Hi, I am writing a program which need parse command line arguments like "--myopt= ion somevalue", and what I found is getopt_long(). After read the man page, I= realize that this function can parse arguments like "--myoption=3Dsomevalue= ", the problem is, the somevalue can be integer only. Is there any function already there to parse command line arguments with str= ing values? If not, I think I need parse argv manually. by= From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:14:56 2017 Return-Path: Delivered-To: freebsd-hackers@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 4AC4FE0CFB4 for ; Thu, 7 Sep 2017 07:14:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC45930 for ; Thu, 7 Sep 2017 07:14:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id k186so2627033ith.0 for ; Thu, 07 Sep 2017 00:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4Juu5r9kfg0VQibUFeNRDkKePzkOC7u9mgQL86gepa8=; b=oc9JNsDcNLxpeWvPP80Jv68WgaqL/peg5xd21K2P29gVM49dzuNTlaYGWvaACKXubL fTHDHYQblwnbtsZt3o1TTnDKXGtHX4q+D8rBo5JfL7/QSi8TuoPtlkBOz/iZQ7V02egM GaBvMMZCHy3hni23Hmu4dWd140pNCjqN4muTvVylNKTfoVZRbUjIVis2Ecacs48GeU4c uXNzY/5/9B/28Qki4UxiOWD6juTCs8el57jOgbtpVEKWX3sMs4cE8BO2Av0vxjiTM72u 7Ej7b3dnMs4zTJJXMiAqWYnVydMEH4rK3D4NWMbLBFqGrSpYHHQ6LK/xElXIZ+PFbYlF iHlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4Juu5r9kfg0VQibUFeNRDkKePzkOC7u9mgQL86gepa8=; b=pies+Nie40vVB/LatwxjMFtaP8b8asTZt8h+ggEaIP45aLnj/3pD3cp4G31xQJNjkf 1vfj+Jzv8v0LI0WocI7HKD1PmlyN6TzFrAOK29Rbj7RSY31KNAs5TbrVWtuWEKngeFte F0TGtoiYBju4Dklp0lbbD3JjzSfqCL288v4HvVFGfjPGIU3hrMC0cFVVd1u8XLMGiy2S meGBpSr10110yFEwXv1WtD847V8qjP9o2NLyFZqbpGh6SjKOv4VNvQck8jEaAjxFXtgQ SSgOaZJPSOSiR2s2U8EIn+lMRv00GBW9MuxPz+2y/VicdRRztG7Z0LWU1YcN83E+Mstm btsQ== X-Gm-Message-State: AHPjjUgi9o5AStd7qu9JQ0Di9aBw4ZQHNWyGNa6Pl7onpAoaBml7pHz/ NsjRusU4QntQnK1cM5LildB1mrpL8n8Z X-Google-Smtp-Source: ADKCNb7S0Z5Jv1j5okXBgIdp/YnoHqT/oGoRSQ3plNF8TE6dcYYd5VZLIVExD7YfxZ7wgcNcaVYdgi1g/KxxG511jhc= X-Received: by 10.36.64.23 with SMTP id n23mr2558670ita.31.1504768494896; Thu, 07 Sep 2017 00:14:54 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Thu, 7 Sep 2017 00:14:54 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:db2:4927:5bc2:25d6] In-Reply-To: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> From: Warner Losh Date: Thu, 7 Sep 2017 01:14:54 -0600 X-Google-Sender-Auth: TrVrMQ5JmP1-Evk5SYsTHq0Pg4w Message-ID: Subject: Re: Parse command line arguments with getopt_long() To: by Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:14:56 -0000 Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restricted to integers. Warner On Thu, Sep 7, 2017 at 12:49 AM, by wrote: > Hi, > > I am writing a program which need parse command line arguments like > "--myoption somevalue", and what I found is getopt_long(). After read the > man page, I realize that this function can parse arguments like > "--myoption=somevalue", the problem is, the somevalue can be integer only. > > Is there any function already there to parse command line arguments with > string values? > > If not, I think I need parse argv manually. > > by > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:38:10 2017 Return-Path: Delivered-To: freebsd-hackers@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 58522E0E738 for ; Thu, 7 Sep 2017 07:38:10 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id DD3176546D for ; Thu, 7 Sep 2017 07:38:09 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 0A9559C945 for ; Thu, 7 Sep 2017 07:39:01 +0000 (UTC) Received: from [192.168.43.15] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id CD33C9C944 for ; Thu, 7 Sep 2017 07:39:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii From: Giulio Ferro Mime-Version: 1.0 (1.0) Date: Thu, 7 Sep 2017 09:38:07 +0200 Message-Id: Subject: Re: devd in jail References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> In-Reply-To: <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> To: freebsd-hackers@freebsd.org X-Mailer: iPhone Mail (14G60) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:38:10 -0000 Hi Alexander, I've installed everything after my custom kernel was installed. And as I sai= d, it differs from GENERIC only for the addition of VIMAGE and bridge. What I can try to do is installing your patches so to remove the devd issue,= and see if it starts like this. Can you point me to patches for 11.1 stable? Thanks=20 Giulio=20 > Il giorno 06 set 2017, alle ore 12:25, Alexander Leidinger ha scritto: >=20 > Quoting Giulio Ferro (from Tue, 5 Sep 2017 20:41:41= +0200): >=20 >>> On 05/09/2017 20:35, Mark Millard wrote: >>> [I've no particular expertise but I noticed in what you >>> reported . . .] >>>=20 >>>> On 2017-Sep-5, at 11:25 AM, Giulio Ferro wrot= e: >>>>=20 >>>> . . . >>>>=20 >>>> Actually I tried to apply the changes to xorg.conf, and now it doesn't t= ry to access devd anymore. >>>>=20 >>>> . . . >>>> [ 797.601] (EE) config/devd: fail to connect to devd >>>> . . . >>> I expect that the "(EE)" indicates an error is being reported >>> and so it is intended as more than an informational notice. >>=20 >>=20 >> Hi Mark, >>=20 >> yes, I missed that! Thanks for raising. >>=20 >> Then I guess it's the same error as occurred before. >>=20 >> It seems that xorg can't help trying to access devd and so it fails in ja= il... >=20 > There are several EE entries in the log. >=20 > [ 796.846] MIT-SHM extension disabled due to lack of kernel support > [ 796.852] (II) AIGLX: Screen 0 is not DRI2 capable > [ 796.852] (EE) AIGLX: reverting to software rendering > [ 797.431] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer >=20 > I don't expect this to be critical. >=20 > Not sure about the devd one. > The segmentation fault is for sure an issue which prevents it from working= , but I don't know if this is related to one of the EE above or not. You wou= ld have to check in the X.org / xrdp area for help (or if you have updated s= ome pieces like OS/jail/kernel/ports since you have installed xrdp, you coul= d try a fresh install of everything to rule-out some inconsistencies which c= ould show up in some edge-cases). >=20 > Bye, > Alexander. >=20 > --=20 > http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF > http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF From owner-freebsd-hackers@freebsd.org Thu Sep 7 06:54:53 2017 Return-Path: Delivered-To: freebsd-hackers@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 1BEC6E0BC75 for ; Thu, 7 Sep 2017 06:54:53 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id A381B80078 for ; Thu, 7 Sep 2017 06:54:52 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id B6ABE9C945 for ; Thu, 7 Sep 2017 06:55:38 +0000 (UTC) Received: from [192.168.43.173] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 7E9C39C944 for ; Thu, 7 Sep 2017 06:55:38 +0000 (UTC) Subject: Re: devd in jail To: freebsd-hackers@freebsd.org References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> From: Giulio Ferro Message-ID: Date: Thu, 7 Sep 2017 08:54:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 06:54:53 -0000 On 06/09/2017 22:19, Alexander Leidinger wrote: > > Quoting Giulio Ferro (from Wed, 6 Sep 2017 > 14:13:52 +0200): > >> Hi Alexander, >> >> I've installed everything after my custom kernel was installed. And >> as I said, it differs from GENERIC only for the addition of VIMAGE >> and bridge. >> >> What I can try to do is installing your patches so to remove the devd >> issue, and see if it starts like this. >> >> Can you point me to patches for 11.1 stable? > > Attached, patch against releng-11.1. Beware, this is not even > compile-tested. And you need the modifications described in a previous > mail for /etc/devfs.rules. > > Bye, > Alexander. > Hi Alexander, I've applied the patch, compiled and install the new kernel. Here's my jail.conf ------------------------------------------------------------ exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.clean; mount.devfs; devfs_ruleset=1; allow.kmem_access; path = "/usr/home/jails/$name"; xx { host.hostname = "xx.xx.xx"; vnet; vnet.interface = epair0b, epair1b; persist; } ------------------------------------------------------------ But the problem now is that the jail doesn't start, if fact it seems it doesn't recognise the parameter: # /etc/rc.d/jail start Starting jails:jail: wsj: unknown parameter: allow.kmem_access I've tried both putting it in the general section and in the xx jail section, but same result. Should I put it somewhere else? From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:33:43 2017 Return-Path: Delivered-To: freebsd-hackers@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 618E3E0E1E5 for ; Thu, 7 Sep 2017 07:33:43 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DFB536447A for ; Thu, 7 Sep 2017 07:33:42 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [10.203.55.86] ([223.104.63.189]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v877XFbc094282 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 07:33:17 GMT (envelope-from by@meetlost.com) Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Thu, 7 Sep 2017 15:33:30 +0800 Cc: "freebsd-hackers@freebsd.org" Message-Id: References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: Warner Losh Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:33:43 -0000 Ok, will do that. Thanks. by >=20 > Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restric= ted to integers. >=20 > Warner >=20 >> On Thu, Sep 7, 2017 at 12:49 AM, by wrote: >> Hi, >>=20 >> I am writing a program which need parse command line arguments like "--my= option somevalue", and what I found is getopt_long(). After read the man pag= e, I realize that this function can parse arguments like "--myoption=3Dsomev= alue", the problem is, the somevalue can be integer only. >>=20 >> Is there any function already there to parse command line arguments with s= tring values? >>=20 >> If not, I think I need parse argv manually. >>=20 >> by >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >=20 From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:42:44 2017 Return-Path: Delivered-To: freebsd-hackers@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 76FD3E0EF94 for ; Thu, 7 Sep 2017 07:42:44 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id D952F6660F for ; Thu, 7 Sep 2017 07:42:43 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 333B79D19D for ; Thu, 7 Sep 2017 07:43:35 +0000 (UTC) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id DB49A9D1AA for ; Thu, 7 Sep 2017 07:43:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mailserver1.etoilesoft.fr X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.1 Received: from secure.etoilesoft.fr (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA for ; Thu, 7 Sep 2017 07:43:34 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 07 Sep 2017 09:43:34 +0200 From: auryn@zirakzigil.org To: freebsd-hackers@freebsd.org Subject: wrong message Message-ID: <2ba3949f0ef5931140c33b2dc38305f7@zirakzigil.org> X-Sender: auryn@zirakzigil.org User-Agent: Roundcube Webmail/1.3-beta X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:42:44 -0000 Please disregard my latest message, it's from yesterday and was sent by mistake... From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:45:31 2017 Return-Path: Delivered-To: freebsd-hackers@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 86842E0F224 for ; Thu, 7 Sep 2017 07:45:31 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id EC8C867106 for ; Thu, 7 Sep 2017 07:45:30 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 4417A9D1AA for ; Thu, 7 Sep 2017 07:46:22 +0000 (UTC) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id AB3A99D19F for ; Thu, 7 Sep 2017 07:46:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mailserver1.etoilesoft.fr X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.1 Received: from secure.etoilesoft.fr (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA for ; Thu, 7 Sep 2017 07:46:21 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 07 Sep 2017 09:46:21 +0200 From: auryn@zirakzigil.org To: freebsd-hackers@freebsd.org Subject: Re: devd in jail In-Reply-To: <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> Message-ID: <85646ec579c6115af69a3dffcec7498d@zirakzigil.org> X-Sender: auryn@zirakzigil.org User-Agent: Roundcube Webmail/1.3-beta X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:45:31 -0000 On 06/09/2017 22:19, Alexander Leidinger wrote: > > Quoting Giulio Ferro (from Wed, 6 Sep 2017 > 14:13:52 +0200): > >> Hi Alexander, >> >> I've installed everything after my custom kernel was installed. And as >> I said, it differs from GENERIC only for the addition of VIMAGE and >> bridge. >> >> What I can try to do is installing your patches so to remove the devd >> issue, and see if it starts like this. >> >> Can you point me to patches for 11.1 stable? > > Attached, patch against releng-11.1. Beware, this is not even > compile-tested. And you need the modifications described in a previous > mail for /etc/devfs.rules. > > Bye, > Alexander. > Hi Alexander, I've applied the patch, compiled and install the new kernel. Here's my jail.conf ------------------------------------------------------------ exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.clean; mount.devfs; devfs_ruleset=1; allow.kmem_access; path = "/usr/home/jails/$name"; xx { host.hostname = "xx.xx.xx"; vnet; vnet.interface = epair0b, epair1b; persist; } ------------------------------------------------------------ But the problem now is that the jail doesn't start, if fact it seems it doesn't recognise the parameter: # /etc/rc.d/jail start Starting jails:jail: wsj: unknown parameter: allow.kmem_access I've tried both putting it in the general section and in the xx jail section, but same result. Should I put it somewhere else? From owner-freebsd-hackers@freebsd.org Thu Sep 7 08:50:23 2017 Return-Path: Delivered-To: freebsd-hackers@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 7132DE12415 for ; Thu, 7 Sep 2017 08:50:23 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA4175402 for ; Thu, 7 Sep 2017 08:50:22 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [192.168.59.242] ([61.141.64.170]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v878nud7094568 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 08:49:57 GMT (envelope-from by@meetlost.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Thu, 7 Sep 2017 16:50:16 +0800 Cc: "freebsd-hackers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: Warner Losh X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 08:50:23 -0000 Seems can not find efivar, which version of FreeBSD you use? I am on 10.3 RELEASE by >=20 > Ok, will do that. > Thanks. >=20 > by >=20 >>=20 >> Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restri= cted to integers. >>=20 >> Warner >>=20 >>> On Thu, Sep 7, 2017 at 12:49 AM, by wrote: >>> Hi, >>>=20 >>> I am writing a program which need parse command line arguments like "--m= yoption somevalue", and what I found is getopt_long(). After read the man pa= ge, I realize that this function can parse arguments like "--myoption=3Dsome= value", the problem is, the somevalue can be integer only. >>>=20 >>> Is there any function already there to parse command line arguments with= string values? >>>=20 >>> If not, I think I need parse argv manually. >>>=20 >>> by >>> _______________________________________________ >>> freebsd-hackers@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.or= g" >>=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"= From owner-freebsd-hackers@freebsd.org Thu Sep 7 10:09:51 2017 Return-Path: Delivered-To: freebsd-hackers@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 C32ACE1554C for ; Thu, 7 Sep 2017 10:09:51 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A09664ECD for ; Thu, 7 Sep 2017 10:09:50 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [10.203.55.86] ([223.104.63.189]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v87A9OC1095028 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 10:09:25 GMT (envelope-from by@meetlost.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> Date: Thu, 7 Sep 2017 18:09:39 +0800 Cc: "freebsd-hackers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <40270B50-819A-4B31-9A1F-FF2424E857D6@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> To: Warner Losh X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 10:09:51 -0000 I got it. It is on 11.1 RELEASE by >=20 > Seems can not find efivar, which version of FreeBSD you use? >=20 > I am on 10.3 RELEASE >=20 > by >=20 >>=20 >> Ok, will do that. >> Thanks. >>=20 >> by >>=20 >>>=20 >>> Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restr= icted to integers. >>>=20 >>> Warner >>>=20 >>>> On Thu, Sep 7, 2017 at 12:49 AM, by wrote: >>>> Hi, >>>>=20 >>>> I am writing a program which need parse command line arguments like "--= myoption somevalue", and what I found is getopt_long(). After read the man p= age, I realize that this function can parse arguments like "--myoption=3Dsom= evalue", the problem is, the somevalue can be integer only. >>>>=20 >>>> Is there any function already there to parse command line arguments wit= h string values? >>>>=20 >>>> If not, I think I need parse argv manually. >>>>=20 >>>> by >>>> _______________________________________________ >>>> freebsd-hackers@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >>>=20 >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"= From owner-freebsd-hackers@freebsd.org Thu Sep 7 10:57:31 2017 Return-Path: Delivered-To: freebsd-hackers@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 38624E178D5 for ; Thu, 7 Sep 2017 10:57:31 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0456F948 for ; Thu, 7 Sep 2017 10:57:30 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id r10so1402127wmf.1 for ; Thu, 07 Sep 2017 03:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ts9iMZTR8mXwZJvWpRBDSc6In6qFPe1ZpwW90ZL1xwY=; b=ZCkX2my+hITbqJjMCbUnCfKkUIhi8pEdswk86vC4ZXP+deCVeBvMCmFpbRAvxcO/cO G8Vv3PtaHjyAvIAeK7LAXACFoov6g6vJVXB4ST7M5PlPW4le1Wxx+ebZk3ruBl6VBy+H VbIVIUPBKba7uu+OwBvMBZAjNBdo8OaeLRntmhiQ1IoyB/KIGLOowBZYOtiC4/NhCpuq x44zxpn1b+olV6yxyDXBV2wD4Lb1Jk8ZVLADK1To9TF43cmZaIS8g4d4+di30nMlzXob wA007lUVZpQyr9oy2BUTWBdaT17lyZVo6tQlXk+WqsUIkbx4Lm8MwlsDaYN031uPI81E TeAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ts9iMZTR8mXwZJvWpRBDSc6In6qFPe1ZpwW90ZL1xwY=; b=duLT9uQzAT64v8aOcqU3dwmtYBcM2jpQlyLm6Ff1Irgdb539HVisDvnpLjwPhu1iWJ pOYDD7eYC2da91AdEHAVAN7o2IrtiGj6tSwB6FmuqHlnDL3YEFOlh9Deo+K+QryYzVn1 jRElozmLJOoVdV9yTKSNkzOn+bjruTNPlA/Yut28uMx/NeTFRfGotqlp7C47q13hBCC7 xoqoV6tFYpwu/daS+kw1JlsDEOsH8cDdp08aeYWfCqcw3RXW7piIGcScthPT/CDlpcEz 2m1IWC2t/k2Nz5u8ZLlWoFLlvrzJ0qF+YvZOILvCtHMfk7WYMVOOvTo6XWXFwcb5851y 1ZLw== X-Gm-Message-State: AHPjjUg/wzAB3k/nRooH2tRs5j2daQ3+5yKwBaTUtyp+1W/sCiDJg0Xd h8eQGxDYsnDohKDFZYtthJ1Z7xV38Q== X-Google-Smtp-Source: ADKCNb5S9OKZej22oh3Mp6T2SPZ5tNFKYVgCoa6H0rwLEdVkouzGhWRzN8Vsxql2UsHgTwQsUYmoyDCUlgzMUggCy38= X-Received: by 10.80.164.163 with SMTP id w32mr2220481edb.63.1504781848648; Thu, 07 Sep 2017 03:57:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.216.197 with HTTP; Thu, 7 Sep 2017 03:57:28 -0700 (PDT) In-Reply-To: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> From: Yubin Ruan Date: Thu, 7 Sep 2017 18:57:28 +0800 Message-ID: Subject: Re: Parse command line arguments with getopt_long() To: by Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 10:57:31 -0000 2017-09-07 14:49 GMT+08:00 by : > Hi, > > I am writing a program which need parse command line arguments like "--my= option somevalue", and what I found is getopt_long(). After read the man pa= ge, I realize that this function can parse arguments like "--myoption=3Dsom= evalue", the problem is, the somevalue can be integer only. > > Is there any function already there to parse command line arguments with = string values? > > If not, I think I need parse argv manually. Will "gflags" be OK? Yubin From owner-freebsd-hackers@freebsd.org Thu Sep 7 11:20:27 2017 Return-Path: Delivered-To: freebsd-hackers@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 94446E18A5C for ; Thu, 7 Sep 2017 11:20:27 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCA17474C for ; Thu, 7 Sep 2017 11:20:26 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [10.203.55.86] ([223.104.63.189]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v87BK05n095317 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 11:20:01 GMT (envelope-from by@meetlost.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Thu, 7 Sep 2017 19:20:16 +0800 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4CE43FB0-BC24-4498-9752-F4DF7F1D43F4@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: Yubin Ruan X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 11:20:27 -0000 Hi, What do you mean of "gflags"? And I think iterate argv would be simple to implement. Just considering whether it is necessary to add this into library if impleme= nt it in a generic way. by > Will "gflags" be OK? >=20 > Yubin >=20 From owner-freebsd-hackers@freebsd.org Thu Sep 7 11:27:44 2017 Return-Path: Delivered-To: freebsd-hackers@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 B3C2AE191B5 for ; Thu, 7 Sep 2017 11:27:44 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E5497612B for ; Thu, 7 Sep 2017 11:27:44 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id r10so1865551wmf.1 for ; Thu, 07 Sep 2017 04:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IlSdWBO/Mz2GcRzPgIzOB+0mOK3Ns5ZYwfDEBG57hlQ=; b=C1pFQwdyZ4jLM8OUniC2/Ub9aDSEvuYVoPY13UXwB7X7GOMfKCHD2Agl4uYiKUVlR6 WWYLACCZ8sJkIKbqN3wIYaS9xvlk69SGkCBHgmWL/U9LlaLBCPpgYV3spLcCqjom3/O/ 4HYijOGJ5c7Bhyx+eFKhTWufy5cN+RQQOBtsgAqbrYcgY56vmTxaiRDsnmrgJ2nzyUBa dwhLyGxofX+xUsWcgSH3L22WROYMHBS5f8urqM54AzQiDsg7DF9vOtdTsjHuM0WQM/ks yfa4qsFUMWdIyfhm7c+HeG66xKYrX4h68uEnsjb7n6s36b9b5NNHP3fCMuG39dqU6E53 chbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IlSdWBO/Mz2GcRzPgIzOB+0mOK3Ns5ZYwfDEBG57hlQ=; b=B/Hf3/XM2k2/BlY12Ju5CN4Zh25qfU50Q6zItdSjfL6LXuJhI6WdsIDMD9QV/57ZeH zA5v05B7WqCL6iJMXOuNyYN0Sq26FF9TLJDPArKkVOaxrEbUvDQayXpn3uzXhLN8iE+F BdPm1BmGthIdYYFVYh9pzK19MAZ4ABqyNZwresJTCmyu7TQ/OVWdCxkf9nNDtwp9YJBz 8RO9C75Erl1zCqDfeIO/xQP6QUdpC2JNvDQ0gNjoYXQI3C17DkVPkvfoCm2thk6NZXc3 na2dGk5lFMT60XqO4bjuB+qnxi3fzBpUTDCiZrfQi+fXfU8sz9zTPgG/Xf0C/O83Tp3i bR/A== X-Gm-Message-State: AHPjjUjzxps6H3eHQWjbTfIjMjfUMyUPmKep7vLjDeWNnPXblfeV+0OS IYmgGmuB9I+8DAbRa+UbZz6vOMj6Ww== X-Google-Smtp-Source: ADKCNb6ikDEwuadgk8Wa88igPCdap+Qse0I6uftja88fpY0sGV5/SRreMorQiX5f5S4/H5WIIdvggEOdoKKdAy44/8U= X-Received: by 10.80.164.163 with SMTP id w32mr2281301edb.63.1504783662488; Thu, 07 Sep 2017 04:27:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.216.197 with HTTP; Thu, 7 Sep 2017 04:27:41 -0700 (PDT) In-Reply-To: <4CE43FB0-BC24-4498-9752-F4DF7F1D43F4@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> <4CE43FB0-BC24-4498-9752-F4DF7F1D43F4@meetlost.com> From: Yubin Ruan Date: Thu, 7 Sep 2017 19:27:41 +0800 Message-ID: Subject: Re: Parse command line arguments with getopt_long() To: by Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 11:27:44 -0000 2017-09-07 19:20 GMT+08:00 by : > Hi, > > What do you mean of "gflags"? > > And I think iterate argv would be simple to implement. > > Just considering whether it is necessary to add this into library if implement it in a generic way. gflags is a library used to parse command line arg, developed and open-sourced by google. Yubin > >> Will "gflags" be OK? >> >> Yubin >> > From owner-freebsd-hackers@freebsd.org Thu Sep 7 11:47:25 2017 Return-Path: Delivered-To: freebsd-hackers@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 E14B8E19DAD for ; Thu, 7 Sep 2017 11:47:25 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8327E541 for ; Thu, 7 Sep 2017 11:47:25 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [10.203.55.86] ([223.104.63.189]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v87Bl0C3095516 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 11:47:01 GMT (envelope-from by@meetlost.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Thu, 7 Sep 2017 19:47:16 +0800 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <50555B87-1EFF-4C1D-92F0-7E98123BD2E6@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> <4CE43FB0-BC24-4498-9752-F4DF7F1D43F4@meetlost.com> To: Yubin Ruan X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 11:47:26 -0000 OK I will take a look about that. by >=20 > 2017-09-07 19:20 GMT+08:00 by : >> Hi, >>=20 >> What do you mean of "gflags"? >>=20 >> And I think iterate argv would be simple to implement. >>=20 >> Just considering whether it is necessary to add this into library if impl= ement it in a generic way. >=20 > gflags is a library used to parse command line arg, developed and > open-sourced by google. >=20 > Yubin >=20 >>=20 >>> Will "gflags" be OK? >>>=20 >>> Yubin >>>=20 >>=20 From owner-freebsd-hackers@freebsd.org Thu Sep 7 19:34:43 2017 Return-Path: Delivered-To: freebsd-hackers@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 9BCB0E0ACB5 for ; Thu, 7 Sep 2017 19:34:43 +0000 (UTC) (envelope-from vglassgow@programmer.net) Received: from mout.gmx.com (mout.gmx.com [74.208.4.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mail.gmx.com", Issuer "thawte SSL CA - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0FA081E55 for ; Thu, 7 Sep 2017 19:34:42 +0000 (UTC) (envelope-from vglassgow@programmer.net) Received: from [71.202.32.232] by 3c-app-mailcom-lxa02.server.lan (via HTTP); Thu, 7 Sep 2017 21:34:35 +0200 Message-ID: From: "victor glassgow" To: freebsd-hackers@freebsd.org Subject: a small part of my vision for freebsd Date: Thu, 7 Sep 2017 21:34:35 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:Rnx4KaJ40HZ0xuXY2/i0liQ/NzBD7Wbpxw6f4qDC/J/ Powa3B7d5jD+KODZq0/tzXWSRclsvyslpp1t9BAA8H3/uSYx9K 6+ZWTBsNxGPh7HW3fXgaHmHCrr77SAdajK8wNd975P9HdOQYAO 8PXeop/YgAqD/GVUlhOkd68RNwzp8g2lcFGJovMbpRn1QeVKlT ScxO7URa/Lu9B7B+NxsBep39tFPnQ3ktkL7Mo5mLIbKAIfuFvi A0kYawiPoTaOTMjrBhfozxG3IsyP6RtJfW7VGSMBLhTUmBV68G pqfNGA= X-UI-Out-Filterresults: notjunk:1;V01:K0:2W7CV4yHou4=:0y0EqUyLG7VqYyjprGUdQx XiXSruJaW205b6kKACYxkpgcoCt0KbH0c06ctUHPMvqZ5DdrwUJ6gsK7ijAoDfMBt3Z+u1LcO LxUOht77AAQ/apZ3mdvLmOyfo1AXftA1COkwvVfm5kD4/O2Qv/4fTbkDvomNVNCHmv21uBDce S6PJkgHmSdtCd/sVMgcUILdVZ+KNCEsW76Xj9bAzX27abyKUI+dLQGl5qIUwn195otc2uJLab q5I45o9oNFQDglFuqec8p8pkI9U/Rc6r1kPNYrtGSVFaOtuq4I3Dh65+mo0Q8fMUnFGQpo27y XUOp5tHhnW6TkT1673L2HzoNEgosIQvwopuGf9jtde+u3kt9ByHaFYL+44mC1kDzxVaAE88fJ cA3mmDGtWeayeDqD+zcIx3Nq7n0iv77fY1JhnCH7DbixVXZPWRJyaco6ABQGKdfszeBm2H15B rAqYmvgwCn61DKJPG0AKe12bsQ2hQD4MhC6LTV1PEARxY04qaTja MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 19:34:43 -0000 From owner-freebsd-hackers@freebsd.org Fri Sep 8 06:07:55 2017 Return-Path: Delivered-To: freebsd-hackers@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 6DD61E05E97 for ; Fri, 8 Sep 2017 06:07:55 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E6A6494C for ; Fri, 8 Sep 2017 06:07:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-154-30.dyn.iinet.net.au [220.253.154.30]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v8867iTj097291 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Sep 2017 23:07:47 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: a small part of my vision for freebsd To: victor glassgow , freebsd-hackers@freebsd.org References: From: Julian Elischer Message-ID: <3563e52f-8b78-cc56-6f72-6c2791abfb75@freebsd.org> Date: Fri, 8 Sep 2017 14:07:38 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 06:07:55 -0000 On 8/9/17 3:34 am, victor glassgow wrote: > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > hmm was there more that got stripped by the list server? From owner-freebsd-hackers@freebsd.org Fri Sep 8 06:19:18 2017 Return-Path: Delivered-To: freebsd-hackers@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 39F1BE06486 for ; Fri, 8 Sep 2017 06:19:18 +0000 (UTC) (envelope-from trafdev@mail.ru) Received: from fallback.mail.ru (fallback13.m.smailru.net [94.100.179.30]) (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 58790671C2; Fri, 8 Sep 2017 06:19:16 +0000 (UTC) (envelope-from trafdev@mail.ru) Received: from [10.161.64.42] (port=52798 helo=smtp34.i.mail.ru) by fallback13.m.smailru.net with esmtp (envelope-from ) id 1dqCdD-0000v2-TE; Fri, 08 Sep 2017 09:19:12 +0300 Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1dqCd4-0005Yl-Jm; Fri, 08 Sep 2017 09:19:03 +0300 Subject: Re: a small part of my vision for freebsd To: Julian Elischer , victor glassgow , freebsd-hackers@freebsd.org References: <3563e52f-8b78-cc56-6f72-6c2791abfb75@freebsd.org> From: trafdev Message-ID: <95628ccc-f1e4-be2e-13fd-b8b3bcd45b37@mail.ru> Date: Thu, 7 Sep 2017 23:18:56 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <3563e52f-8b78-cc56-6f72-6c2791abfb75@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-7FA49CB5: 0D63561A33F958A5AA32CD41FF2574603E4816160A030420FA6CCD07A28DC3A7725E5C173C3A84C3AC5A9AD2E624327B0D275EDD4E9BAB2E026D3A1080F4EF5CC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F2AF38021CC9F462D574AF45C6390F7469DAA53EE0834AAEE X-Mailru-Sender: 3DC3EBC11F0BCE5B68BC1B7F01B6D152CBE391218FDAC92B5774DCC568D8BD415D79BE02CE568C1AADF500B581EA1E492D063C67CFD4E849954DEF1BE664373F92CFA38D0130A48967EA787935ED9F1B X-Mras: OK X-7FA49CB5: 0D63561A33F958A549B182059890EAA2FF98B63810369A04AE16630B13F443BE462275124DF8B9C99B0B8D173C204012BD9CCCA9EDD067B1EDA766A37F9254B7 X-Mailru-Sender: A5480F10D64C90056DE2D996C7A195561AD1FA599FF35589D4925BE6C1955DFA52685D71546B8E9E601D6E3165EAD397C77752E0C033A69E7A8C3768F8E4DEB7AD818CEE1F0DEEE73453F38A29522196 X-Mras: OK X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 06:19:18 -0000 No, seems the part of the vision is really small... On 09/07/17 23:07, Julian Elischer wrote: > On 8/9/17 3:34 am, victor glassgow wrote: >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to >> "freebsd-hackers-unsubscribe@freebsd.org" >> > hmm was there more that got stripped by the list server? > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Fri Sep 8 09:03:37 2017 Return-Path: Delivered-To: freebsd-hackers@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 7A2B7E0C1EB for ; Fri, 8 Sep 2017 09:03:37 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0E426A208 for ; Fri, 8 Sep 2017 09:03:36 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by mail-it0-x230.google.com with SMTP id o200so429300itg.0 for ; Fri, 08 Sep 2017 02:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+9USscWRPRqYurtr/k44BjhodmwNe8YraeXVGkCp8Oc=; b=jh/HEqC+6TsydD83wO3pLsomj/a6QDrfo5XIo1jeDcjpr1G1Nq6ahKPe4aUBpcCvuP dnHC0tqXxrAx5/1PLw3iOyXSZ7PF7uZgO61yLDLy10au0HCoErwJdnT9n0n73F2EiwoG ZdwLJyVK30mfEDkpwn5pREOibnhnQdYiUPNamvpywSfojWfIocc8ZZJZeYTho4jMcKo7 ipWNkjc9I+PaLg3L/wVBrrajA477PlrbYeD45N3oWvUeOZ9LQQleceZgVBKAyUViDSUS IDgZMyuyKGGvvVeP53/uNKmypH0ikeAIjwhi1WOW2i121up747VTWgwhxfFoFLhDbM3t qNPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+9USscWRPRqYurtr/k44BjhodmwNe8YraeXVGkCp8Oc=; b=YHsXEwtsUMiXmN99tHnfmKG4cLOQBn84ym50rlf65OXox1S1AR9a1akpG9v3t0f5jP YGgle5pjH8h7Lr2R9itlZF7fLgjQLrKXoR7ISCiGyc1JBmJ78BAgn4jI/tPQRkaNdP+D UkWuJNroLNtrHNdN8+J/oRUIrv4lw7BU4mZc6uVHeXgi7klZsZ3jhIYScoqRJQb4CnqZ Uzv3decJedV1WxjzqrMG9zQDzBVSx6wu0ji5IZIlG4TBTLmxKL4p2KIMZ5BuycV9sLWa MhecdDN9PZ/cx6DDgJmecApAEBYlCsOAAbiyYwqoPvZw07ZF7L3W0iyEMZ9sAgBpCU94 iOWw== X-Gm-Message-State: AHPjjUjbeSn1r5WwmUwjEoFXAiJYawGMcxhI2m8LVZZIjs+f2EB6YKnA SM62F0cdI+BmJIdGOvJOF3oWAeW+xw== X-Google-Smtp-Source: AOwi7QBhQLYFVuACk6kjRu+BXb18lRxyCNpj+QxaWDi8Ep08D8xx7VQKynba9Hcn9q8i8+GMM7atvMrSu/kwmA6WeIY= X-Received: by 10.36.162.70 with SMTP id o6mr2260190iti.156.1504861415745; Fri, 08 Sep 2017 02:03:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.10.199 with HTTP; Fri, 8 Sep 2017 02:03:35 -0700 (PDT) From: Aryeh Friedman Date: Fri, 8 Sep 2017 05:03:35 -0400 Message-ID: Subject: Why does rpc.lockd(8) and rpc.stat(8) require a working Internet connection To: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 09:03:37 -0000 My cable modem was out for a few hours last night and my NFS based *LOCAL* (same subnet [192.168.11.XXX] and physical LAN) file server started glitching up on attempting to contact lockd and statd on the server from the client(s) saying that the service was non-responsive and/or the server couldn't be found. I attempted to switch over to /etc/hosts based host resolution to no avail. I also tried switching to purely IP addr based connections to no avail. Note NIS/YP kept working. Several questions: 1. How do I make it so I can completely disconnect my LAN from the rest of the Internet and not have NFS fail like this 2. Why does NFS require a live internet connection? -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org From owner-freebsd-hackers@freebsd.org Fri Sep 8 12:14:57 2017 Return-Path: Delivered-To: freebsd-hackers@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 B0B13E14E3B for ; Fri, 8 Sep 2017 12:14:57 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0070.outbound.protection.outlook.com [104.47.36.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80D2571FBF for ; Fri, 8 Sep 2017 12:14:55 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM (52.132.78.18) by YQXPR0101MB1398.CANPRD01.PROD.OUTLOOK.COM (52.132.81.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 12:14:54 +0000 Received: from YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM ([fe80::7548:a72a:e054:70d5]) by YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM ([fe80::7548:a72a:e054:70d5%13]) with mapi id 15.20.0035.016; Fri, 8 Sep 2017 12:14:54 +0000 From: Rick Macklem To: Aryeh Friedman , FreeBSD Mailing List Subject: Re: Why does rpc.lockd(8) and rpc.stat(8) require a working Internet connection Thread-Topic: Why does rpc.lockd(8) and rpc.stat(8) require a working Internet connection Thread-Index: AQHTKIFhyJ0Qsqprb0uJKE4WjcCXIKKq5KOD Date: Fri, 8 Sep 2017 12:14:54 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQXPR0101MB1398; 6:bb2oQNyrhd1OPG1qySfXvJNjVfTPDXMYmpHzgsB6gKKS/XlzeHAFgVZ1PIwfTU09XswwqJ8X4pSrzlLA7gtQbjrLu280dGlGS9Unc/DHkGXkfWCmiTNycc3q/BVptYtSQQOr8wLnPt4/11vYUkIvRsvRc2N82dRZ3KgvlzY+CgCzfPUqwQtE1K5o2WEwAFDQynaESaU2A0O1IlDfO4/Bphz62CPFaz1YkK61mHZBeP79TzG+MMevc6mLOG0UE0gtnKyOpk9+pCfI3UbUASFX7TFnMR8hpnbuXzX+br1wG00PFp8vvZF/oXhGHlXFJYdIn8a8I/1HH8I5IvJTDjJUAw==; 5:Lr8U9Mn+YJRD3os9D74dh9E6R8n/zMdsmzHk1vzephYQLRa5S1ib0vCZajYAGSk9W2gBO0yTNAFuzmi1NnFl1vI+l7coNvxNuyQjkaTDHFWd5H/N048v7dAvdoF28floeoBlw4AxSHon8+AVtPFofQ==; 24:Eo3RRy1z09Ey3YQ23+vDH+/s9pgD0kiR4If6uX4ffNFv0yzP9kjlxBgKmoRJvPT9PNNp1E66piquFTQVLpe43ms/RjqKcnB8PZRnVE9O0Vg=; 7:bdK/DNPswTjbY4j/xKKvW+qrkBSAJNrMCW/h/3RmiF9hlkheNQ0t+rrdX0Ow/20C4YyZuIsXxTSjeh33kiUhjmE197ci+MV0R2A69v442/jTjyOhSk2N9Rzt3g9Abki6y7yIHrMhC87CG+hWwvU2fIqtc5x+/WrEQsh/n2zXeol9Fl9KBU9xBdDRhVu8VGx0tgpMLU86OKS9RhwiHYStzaoP93SKiyYImx5gDR7IYeg= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 545308bc-0fd7-4b8a-75c0-08d4f6b336f8 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:YQXPR0101MB1398; x-ms-traffictypediagnostic: YQXPR0101MB1398: x-exchange-antispam-report-test: UriScan:(158342451672863)(278428928389397); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123560025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:YQXPR0101MB1398; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:YQXPR0101MB1398; x-forefront-prvs: 04244E0DC5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(24454002)(97736004)(5250100002)(101416001)(14454004)(50986999)(305945005)(478600001)(39060400002)(54356999)(76176999)(102836003)(25786009)(74482002)(53936002)(6246003)(8676002)(55016002)(9686003)(81166006)(81156014)(8936002)(5660300001)(105586002)(68736007)(106356001)(2906002)(229853002)(7696004)(2950100002)(189998001)(33656002)(3660700001)(2900100001)(6436002)(74316002)(3280700002)(86362001)(6506006)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQXPR0101MB1398; H:YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2017 12:14:54.6976 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQXPR0101MB1398 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 12:14:58 -0000 Aryeh Friedman wrote: >My cable modem was out for a few hours last night and my NFS based *LOCAL* >(same subnet [192.168.11.XXX] and physical LAN) file server started >glitching up on attempting to contact lockd and statd on the server from >the client(s) saying that the service was non-responsive and/or the server >couldn't be found. I attempted to switch over to /etc/hosts based host >resolution to no avail. I also tried switching to purely IP addr based >connections to no avail. Note NIS/YP kept working. I am not the author and am not that familiar with the protocols (they are n= ot NFS), but my understanding is that rpc.statd's job is to determine which other sy= stems are up and running and does IP broadcast etc to do so. >Several questions: > >1. How do I make it so I can completely disconnect my LAN from the rest of >the Internet and not have NFS fail like this? Well, unless you run applications that concurrently share files across mult= iple clients doing locking on them to co-ordinate their activities.. I recommend not using rpc.lockd/rpc.statd. If you do your mounts with the option "nolockd" (called "nolock" on Linux, I think?), the locking is done = locally within the client and the daemons are not needed. If you really need locking to work across multiple clients (as described ab= ove), I'd recommend switching to NFSv4 mounts. (options "nfsv4,minorversion=3D1"). >2. Why does NFS require a live internet connection? Sorry, don't know the answer to this, unless the loss of the cable modem so= mehow affected IP broadcast. rick, who refused to implement lockd/statd long ago, due to limitations (an= d lack of published specifications) of the protocols.= From owner-freebsd-hackers@freebsd.org Fri Sep 8 14:24:54 2017 Return-Path: Delivered-To: freebsd-hackers@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 80810E1AB9B for ; Fri, 8 Sep 2017 14:24:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0509781380 for ; Fri, 8 Sep 2017 14:24:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id q132so6000716lfe.5 for ; Fri, 08 Sep 2017 07:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Nd9L+tIcvEQx4zIOII/FNZTl1pYqrS8xACcDeuYxqbY=; b=CLprVg3+RNt1o56obFoqTpzG/H21hRnhw0EKPnBC9SVLTS5a8bQnpMcnSok/rX/sx5 28mJgDIw8Qrea+Osnzj/fmTSVHv0wrrIrWtC5hBuMq0BQ3k2GozqKBKMeUgAd//3K/T2 CH/MmYZ6w/QL2rUWb0ILow9MEN1iCfABY2r4blwqQoULRS68GKCQQuaNeIXF9v7hFXm3 DtQQxwhzbaq/fetUSFqYsTB6yPUM25xBu54TT05qetx1zlMYIEXtqBwwWLxMUBOR5SNN uGuxW/DkwwHuydgXhzh5LAWyfBitgD5uZMkN9YtH3usghNJleJPrnrR5r8Hrw9TKgipl kFKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Nd9L+tIcvEQx4zIOII/FNZTl1pYqrS8xACcDeuYxqbY=; b=AttZDPrH5vlllEyXV2m+MWvzrA73DerwzXP7+R1y7UDf72ptRH6VbB/Kd7zt3bjq3j euoIhVqS+pwNn07km6tHwuuWDfPBgYgviSmvsfsAB/XsLQzrHgjQSsXQ7zGvdGp4If5Z KPqPeBslgyhmz1S5vVSXaesauNAOamS/FYWcQKc3MugDis9mjXKtGEdn1SynrFt/zDY5 iQ2GRSTRVOXrY2V96ZTHNg9ZqhKXs/FYrEAk3MjauBkcdMNyw+mJ4okUkK88AB5xK798 de6lNq/neS8lRuCfoAAZaiDsISi4Jnp6zUCY4I9eRv1DuIm3fp/IZ7sZg0TyNovMgXQ8 K1hw== X-Gm-Message-State: AHPjjUh/bvwLvaq7OgcMtW4kDa6TfPa2VutJfPONqZ2cYQMMjnXwqu73 5NE3kf1hI6/Zl2Wd4I4qmrLkvl7DZw== X-Google-Smtp-Source: AOwi7QDPOxeozNl9g+ajMHaVkoSlm7mvXgTSeEdVxVGTakv9S2Y5qHapU/nwr2Q2GHezFJjuqRJNjDYH9zfXWRPEfS0= X-Received: by 10.25.87.74 with SMTP id l71mr993000lfb.193.1504880692090; Fri, 08 Sep 2017 07:24:52 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.26.6 with HTTP; Fri, 8 Sep 2017 07:24:51 -0700 (PDT) In-Reply-To: References: From: Alan Somers Date: Fri, 8 Sep 2017 08:24:51 -0600 X-Google-Sender-Auth: _Myk4HMsrGGKv5S4AuoeGcWutaQ Message-ID: Subject: Re: Why does rpc.lockd(8) and rpc.stat(8) require a working Internet connection To: Aryeh Friedman Cc: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 14:24:54 -0000 On Fri, Sep 8, 2017 at 3:03 AM, Aryeh Friedman wrote: > My cable modem was out for a few hours last night and my NFS based *LOCAL* > (same subnet [192.168.11.XXX] and physical LAN) file server started > glitching up on attempting to contact lockd and statd on the server from > the client(s) saying that the service was non-responsive and/or the server > couldn't be found. I attempted to switch over to /etc/hosts based host > resolution to no avail. I also tried switching to purely IP addr based > connections to no avail. Note NIS/YP kept working. > > Several questions: > > 1. How do I make it so I can completely disconnect my LAN from the rest of > the Internet and not have NFS fail like this > > 2. Why does NFS require a live internet connection? > > -- > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org My guess would be DNS. If your cable _modem_ (not just connection) was out, and your machines are configured to use the cable modem as their DNS server, and rpc.statd tried to do a reverse DNS lookup of your client's IP address, then that might cause it to hang. Using /etc/hosts was a sensible move. Perhaps you accidentally left out an address? If it happens again you could use tcpdump to see if anything is trying to contact the cable modem's DNS port. -Alan From owner-freebsd-hackers@freebsd.org Sat Sep 9 13:03:50 2017 Return-Path: Delivered-To: freebsd-hackers@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 B5382E15778 for ; Sat, 9 Sep 2017 13:03:50 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:375::1:5]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8C86870F for ; Sat, 9 Sep 2017 13:03:50 +0000 (UTC) (envelope-from Alexander@leidinger.net) Date: Sat, 09 Sep 2017 15:03:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1504962226; bh=A6OInNNtKjhiwksNoxJNRPvSuMyYIoiTCoZnLxU2p84=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Ywgwc1r+6TogaRLrpwmjx/mSctTZ5SFHsH67y92oiRN2YjJoCq6nPNbfi6FJP6T88 Geenwh2GSHTLLR2fPtcbWkmVY3zQiqNPJLNLqEBRfL8vfUAgBanbBoUCWThodhBXGD qWODnzIybuOShWb/niz2ohCQ5EsfYOtYlRLWNVmdu0/3G9uxMyNag2vvyLXUrcuRGk zHccY9ycxptGEJL/KepkveRO5Dc9WtlugB38epT8a26yw0/Nk8YFREBwX2DUp5EyIf F9vNcpeDjuiA00DGual1IfAvujF3ADBwmkvq4ME34v7P1R1Jk7i0Jq/kcUnOdn3xG4 YXSx8kc1Skg9w== Message-ID: <20170909150335.Horde.wBLIPwBuhV3lyQlBxKud39f@webmail.leidinger.net> From: Alexander Leidinger To: Giulio Ferro Cc: freebsd-hackers@freebsd.org Subject: Re: devd in jail References: <20170810225439.Horde.1s8Qi_dlNtxgEigsNKbdrer@webmail.leidinger.net> <4a1a99a5-35ea-19c9-7ac8-77875ac6f71f@zirakzigil.org> <20170905151537.Horde.10cHNOX1OVri7mGaUcDeX1l@webmail.leidinger.net> <7ca865ee-b613-2f0c-daf0-d828884b5e74@zirakzigil.org> <1C181EF2-B8B1-4F42-BF80-ABEA0593DD43@dsl-only.net> <20170906122556.Horde.5OdDwtii7HXPNArY77YUyBi@webmail.leidinger.net> <20170906221947.Horde.RITHvdc1wVE9v0-3nBavR0Z@webmail.leidinger.net> In-Reply-To: User-Agent: Horde Application Framework 5 Content-Type: multipart/signed; boundary="=_14Pv1yrjtMyG8jTArdSSw8E"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 09 Sep 2017 14:57:01 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Sep 2017 13:03:50 -0000 This message is in MIME format and has been PGP signed. --=_14Pv1yrjtMyG8jTArdSSw8E Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Giulio Ferro (from Thu, 7 Sep 2017=20=20 08:54:45=20+0200): > I've applied the patch, compiled and install the new kernel. > > > Here's my jail.conf [jail.conf] > But the problem now is that the jail doesn't start, if fact it seems=20= =20 >=20it doesn't recognise the parameter: > > > # /etc/rc.d/jail start > Starting jails:jail: wsj: unknown parameter: allow.kmem_access > > > I've tried both putting it in the general section and in the xx jail=20= =20 >=20section, but same result. > > > Should I put it somewhere else? I don't use jail.conf, I use ezjail or iocage. From my reading of the=20=20 jail-command=20source code, it looks like it should work there if it is=20= =20 OK=20in the kernel (no modification to the source of the jail-command=20=20 necessary).=20This suggests it is not really OK in the kernel. Please run this: strings /boot/kernel/kernel| grep allow.kmem If it doesn't print out "allow.kmem_access", then your kernel doesn't=20=20 contain=20the patch. Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_14Pv1yrjtMyG8jTArdSSw8E Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJZs+anAAoJEKrxQhqFIICEddoQALdH17E/1rC71z47mAa4wPUc M3+ITKyLRxxtsj3Ncw29KL2lOCeNqWVWW8cDEEd0lgLICrjPc8ph8tlx2D0qob/k Aqvk4R6RdBDjAVKCgQazpUbjeB/H03xdIPPCOj8FOF1qguZZyHrbbAkY1dqyFlr9 i3hXCYiM27FvGyELkxM/HuwqAMDUwbVgOUcv25WDKpD4NMbAwngIXOKpK6qlEihJ uffCUJB+5wsAj6yc8mzF2Xtd/ThwIx3wZcQJpnhRcPadibkSB3Ts6oTAEvv7PxBr B32AzssewhbpOVQ0EDAxSzZjUbkxh7lPjvDMW/jIcEpBtjj4YN4aWDc60T23rN52 WbnkP7NheOu/UIT8QxwfqmB9e2luR6hpR9SATfi01394LTm4UBN++lfxojGjsBdH B8AaZLazXqGGZPJpnsy7FSHWxf51wdibVclJ2O5HeG+bRTj+0iHjYeN+phHCJkKa FbVShwn0zE1Pk4tPhGQzwdkKmuN47ld+rKqYx/J5S+d+0pf3QVpHhuxBBvPTdL0B lVcD5dVYyIcB1z3A6VwRUiqS+OnyJzB+cNu41/pw1gN6QAcb0BEOHvPSoeOYG22d TyIBVZslJWPK2kAU66Y6veINJSKo9xIML0oVKZCFXF1xzdRPrPmP4SIz61rZZTNB /Gxvc33gLPp8K7u68fXq =73Ri -----END PGP SIGNATURE----- --=_14Pv1yrjtMyG8jTArdSSw8E--