NetBSD Problem Report #55544

From www@netbsd.org  Wed Aug  5 19:30:40 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 24CFC1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  5 Aug 2020 19:30:40 +0000 (UTC)
Message-Id: <20200805193039.3567A1A923B@mollari.NetBSD.org>
Date: Wed,  5 Aug 2020 19:30:39 +0000 (UTC)
From: joernc@gmail.com
Reply-To: joernc@gmail.com
To: gnats-bugs@NetBSD.org
Subject: sysutils/ansible: use /proc/mounts
X-Send-Pr-Version: www-1.0

>Number:         55544
>Category:       pkg
>Synopsis:       sysutils/ansible: use /proc/mounts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 05 19:35:00 +0000 2020
>Last-Modified:  Fri Aug 07 08:55:01 +0000 2020
>Originator:     Joern Clausen
>Release:        
>Organization:
>Environment:
>Description:
The fact gathering code for NetBSD already uses /proc in some cases, but reads /etc/fstab to find mounted filesystems. This misses usually (well, at least in my case) ZFS mounts, which are no longer documented there.

>How-To-Repeat:
$ ansible foo -m setup

will not report mounts on foo except those documented in /etc/fstab
>Fix:
https://github.com/ansible/ansible/pull/71113 is a pull request to read /proc/mounts instead. Until (if ever) it makes it to a release, a local patch in pkgsrc would be nice.

>Audit-Trail:
From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts
Date: Wed, 5 Aug 2020 22:40:01 +0200

 On Wed, Aug 05, 2020 at 07:35:00PM +0000, joernc@gmail.com wrote:
 > >Number:         55544
 > >Category:       pkg
 > >Synopsis:       sysutils/ansible: use /proc/mounts
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    pkg-manager
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Wed Aug 05 19:35:00 +0000 2020
 > >Originator:     Joern Clausen
 > >Release:        
 > >Organization:
 > >Environment:
 > >Description:
 > The fact gathering code for NetBSD already uses /proc in some cases, but reads /etc/fstab to find mounted filesystems. This misses usually (well, at least in my case) ZFS mounts, which are no longer documented there.
 > 
 > >How-To-Repeat:
 > $ ansible foo -m setup
 > 
 > will not report mounts on foo except those documented in /etc/fstab
 > >Fix:
 > https://github.com/ansible/ansible/pull/71113 is a pull request to read /proc/mounts instead. Until (if ever) it makes it to a release, a local patch in pkgsrc would be nice.

 What about using mount(8) instead? Not every system has /proc mounted...

 Joerg

From: =?UTF-8?Q?J=C3=B6rn_Clausen?= <joernc@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts
Date: Thu, 6 Aug 2020 08:32:24 +0200

 --00000000000066113105ac2fa704
 Content-Type: text/plain; charset="UTF-8"

 Feel free to provide a better solution.

 I have a) no skills in programming Python and b) no knowledge of the inner
 workings of ansible (or the desire to learn them). The current code is 3
 years old, and already uses /proc/cpuinfo and /proc/meminfo, so this is
 just a normalization of what is already there.

 On Wed, Aug 5, 2020 at 10:45 PM Joerg Sonnenberger <joerg@bec.de> wrote:

 > The following reply was made to PR pkg/55544; it has been noted by GNATS.
 >
 > From: Joerg Sonnenberger <joerg@bec.de>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts
 > Date: Wed, 5 Aug 2020 22:40:01 +0200
 >
 >  On Wed, Aug 05, 2020 at 07:35:00PM +0000, joernc@gmail.com wrote:
 >  > >Number:         55544
 >  > >Category:       pkg
 >  > >Synopsis:       sysutils/ansible: use /proc/mounts
 >  > >Confidential:   no
 >  > >Severity:       serious
 >  > >Priority:       medium
 >  > >Responsible:    pkg-manager
 >  > >State:          open
 >  > >Class:          sw-bug
 >  > >Submitter-Id:   net
 >  > >Arrival-Date:   Wed Aug 05 19:35:00 +0000 2020
 >  > >Originator:     Joern Clausen
 >  > >Release:
 >  > >Organization:
 >  > >Environment:
 >  > >Description:
 >  > The fact gathering code for NetBSD already uses /proc in some cases,
 > but reads /etc/fstab to find mounted filesystems. This misses usually
 > (well, at least in my case) ZFS mounts, which are no longer documented
 > there.
 >  >
 >  > >How-To-Repeat:
 >  > $ ansible foo -m setup
 >  >
 >  > will not report mounts on foo except those documented in /etc/fstab
 >  > >Fix:
 >  > https://github.com/ansible/ansible/pull/71113 is a pull request to
 > read /proc/mounts instead. Until (if ever) it makes it to a release, a
 > local patch in pkgsrc would be nice.
 >
 >  What about using mount(8) instead? Not every system has /proc mounted...
 >
 >  Joerg
 >
 >

 -- 
 Joern Clausen
 https://www.oe-files.de/photography/

 --00000000000066113105ac2fa704
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr"><div>Feel free to provide a better solution.</div><div><br=
 ></div><div>
 <div>I have a) no skills in programming Python and b) no knowledge of=20
 the inner workings of ansible (or the desire to learn them). The current
  code is 3 years old, and already uses /proc/cpuinfo and /proc/meminfo,=20
 so this is just a normalization of what is already there.</div>

 </div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_=
 attr">On Wed, Aug 5, 2020 at 10:45 PM Joerg Sonnenberger &lt;<a href=3D"mai=
 lto:joerg@bec.de">joerg@bec.de</a>&gt; wrote:<br></div><blockquote class=3D=
 "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
 04,204,204);padding-left:1ex">The following reply was made to PR pkg/55544;=
  it has been noted by GNATS.<br>
 <br>
 From: Joerg Sonnenberger &lt;<a href=3D"mailto:joerg@bec.de" target=3D"_bla=
 nk">joerg@bec.de</a>&gt;<br>
 To: <a href=3D"mailto:gnats-bugs@netbsd.org" target=3D"_blank">gnats-bugs@n=
 etbsd.org</a><br>
 Cc: <br>
 Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts<br>
 Date: Wed, 5 Aug 2020 22:40:01 +0200<br>
 <br>
 =C2=A0On Wed, Aug 05, 2020 at 07:35:00PM +0000, <a href=3D"mailto:joernc@gm=
 ail.com" target=3D"_blank">joernc@gmail.com</a> wrote:<br>
 =C2=A0&gt; &gt;Number:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A055544<br>
 =C2=A0&gt; &gt;Category:=C2=A0 =C2=A0 =C2=A0 =C2=A0pkg<br>
 =C2=A0&gt; &gt;Synopsis:=C2=A0 =C2=A0 =C2=A0 =C2=A0sysutils/ansible: use /p=
 roc/mounts<br>
 =C2=A0&gt; &gt;Confidential:=C2=A0 =C2=A0no<br>
 =C2=A0&gt; &gt;Severity:=C2=A0 =C2=A0 =C2=A0 =C2=A0serious<br>
 =C2=A0&gt; &gt;Priority:=C2=A0 =C2=A0 =C2=A0 =C2=A0medium<br>
 =C2=A0&gt; &gt;Responsible:=C2=A0 =C2=A0 pkg-manager<br>
 =C2=A0&gt; &gt;State:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 open<br>
 =C2=A0&gt; &gt;Class:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sw-bug<br>
 =C2=A0&gt; &gt;Submitter-Id:=C2=A0 =C2=A0net<br>
 =C2=A0&gt; &gt;Arrival-Date:=C2=A0 =C2=A0Wed Aug 05 19:35:00 +0000 2020<br>
 =C2=A0&gt; &gt;Originator:=C2=A0 =C2=A0 =C2=A0Joern Clausen<br>
 =C2=A0&gt; &gt;Release:=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>
 =C2=A0&gt; &gt;Organization:<br>
 =C2=A0&gt; &gt;Environment:<br>
 =C2=A0&gt; &gt;Description:<br>
 =C2=A0&gt; The fact gathering code for NetBSD already uses /proc in some ca=
 ses, but reads /etc/fstab to find mounted filesystems. This misses usually =
 (well, at least in my case) ZFS mounts, which are no longer documented ther=
 e.<br>
 =C2=A0&gt; <br>
 =C2=A0&gt; &gt;How-To-Repeat:<br>
 =C2=A0&gt; $ ansible foo -m setup<br>
 =C2=A0&gt; <br>
 =C2=A0&gt; will not report mounts on foo except those documented in /etc/fs=
 tab<br>
 =C2=A0&gt; &gt;Fix:<br>
 =C2=A0&gt; <a href=3D"https://github.com/ansible/ansible/pull/71113" rel=3D=
 "noreferrer" target=3D"_blank">https://github.com/ansible/ansible/pull/7111=
 3</a> is a pull request to read /proc/mounts instead. Until (if ever) it ma=
 kes it to a release, a local patch in pkgsrc would be nice.<br>
 <br>
 =C2=A0What about using mount(8) instead? Not every system has /proc mounted=
 ...<br>
 <br>
 =C2=A0Joerg<br>
 <br>
 </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
 mail_signature">Joern Clausen<br><a href=3D"https://www.oe-files.de/photogr=
 aphy/" target=3D"_blank">https://www.oe-files.de/photography/</a></div>

 --00000000000066113105ac2fa704--

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55544 CVS commit: pkgsrc/sysutils/ansible
Date: Fri, 7 Aug 2020 07:40:42 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Fri Aug  7 07:40:42 UTC 2020

 Modified Files:
 	pkgsrc/sysutils/ansible: Makefile distinfo
 Added Files:
 	pkgsrc/sysutils/ansible/patches:
 	    patch-lib_ansible_module__utils_facts_hardware_netbsd.py

 Log Message:
 ansible: parse the output of mount(8) instead of /etc/fstab.
 bump PKGREVISION

 PR pkg/55544


 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 pkgsrc/sysutils/ansible/Makefile
 cvs rdiff -u -r1.21 -r1.22 pkgsrc/sysutils/ansible/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/sysutils/ansible/patches/patch-lib_ansible_module__utils_facts_hardware_netbsd.py

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts
Date: Fri, 7 Aug 2020 07:43:10 +0000

 I changed this to use mount(8) but I think expecting correct behaviour
 without /proc mounted from this code is a stretch. It uses /proc
 heavily.

From: =?UTF-8?Q?J=C3=B6rn_Clausen?= <joernc@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/55544: sysutils/ansible: use /proc/mounts
Date: Fri, 7 Aug 2020 10:51:05 +0200

 --00000000000035728b05ac45b5ef
 Content-Type: text/plain; charset="UTF-8"

 >  I changed this to use mount(8) but I think expecting correct behaviour
 >  without /proc mounted from this code is a stretch. It uses /proc
 >  heavily.
 >

 Which is, unless someone provides a complete rewrite of the NetBSD hardware
 module in ansible, why I consider my proposed change the more consistent
 solution.

 Feel free to add this patch to pkgsrc (and upstream), but I don't consider
 it a solution for this PR.

 -- 
 Joern Clausen
 https://www.oe-files.de/photography/

 --00000000000035728b05ac45b5ef
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr"><div dir=3D"ltr"></div><div class=3D"gmail_quote"><blockqu=
 ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
  solid rgb(204,204,204);padding-left:1ex">
 =C2=A0I changed this to use mount(8) but I think expecting correct behaviou=
 r<br>
 =C2=A0without /proc mounted from this code is a stretch. It uses /proc<br>
 =C2=A0heavily.<br>
 </blockquote></div><div><br></div><div>Which is, unless someone provides a =
 complete rewrite of the NetBSD hardware module in ansible, why I consider m=
 y proposed change the more consistent solution.<br></div><div><br></div><di=
 v>Feel free to add this patch to pkgsrc (and upstream), but I don&#39;t con=
 sider it a solution for this PR.<br></div><div><br></div>-- <br><div dir=3D=
 "ltr" class=3D"gmail_signature">Joern Clausen<br><a href=3D"https://www.oe-=
 files.de/photography/" target=3D"_blank">https://www.oe-files.de/photograph=
 y/</a></div></div>

 --00000000000035728b05ac45b5ef--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.