diff mbox series

[meta-networking] net-snmp: Set ps flag value since it checks the host

Message ID 20240709004123.1330033-1-jpuhlman@mvista.com
State Accepted
Headers show
Series [meta-networking] net-snmp: Set ps flag value since it checks the host | expand

Commit Message

Jeremy Puhlman July 9, 2024, 12:41 a.m. UTC
From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>

The value the configure script uses is picked up
from the host machine ps, and there are cases when
the flag selection can be different. Which would
break reproducablity between builds on different
machines.

Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
---
 meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 +
 1 file changed, 1 insertion(+)

Comments

Khem Raj July 9, 2024, 1 a.m. UTC | #1
On Mon, Jul 8, 2024 at 5:41 PM Jeremy Puhlman via
lists.openembedded.org <jpuhlman=mvista.com@lists.openembedded.org>
wrote:
>
> From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>
>
> The value the configure script uses is picked up
> from the host machine ps, and there are cases when
> the flag selection can be different. Which would
> break reproducablity between builds on different
> machines.
>
> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
> ---
>  meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> index 75b3d9e8c..989ec5413 100644
> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> @@ -73,6 +73,7 @@ CACHED_CONFIGUREVARS = " \
>      lt_cv_shlibpath_overrides_runpath=yes \
>      ac_cv_path_UNAMEPROG=${base_bindir}/uname \
>      ac_cv_path_PSPROG=${base_bindir}/ps \
> +    ac_cv_ps_flags="-e" \

While this change seems ok, I wonder if then we also need to ensure
that procps provided ps utility is rdepend'ed upon too.

>      ac_cv_file__etc_printcap=no \
>      NETSNMP_CONFIGURE_OPTIONS= \
>  "
> --
> 2.35.7
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#111270): https://lists.openembedded.org/g/openembedded-devel/message/111270
> Mute This Topic: https://lists.openembedded.org/mt/107114904/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Jeremy Puhlman July 9, 2024, 1 a.m. UTC | #2
This is also needed on kirkstone and scarthgap.

On 7/8/2024 5:41 PM, jpuhlman@mvista.com wrote:
> From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>
>
> The value the configure script uses is picked up
> from the host machine ps, and there are cases when
> the flag selection can be different. Which would
> break reproducablity between builds on different
> machines.
>
> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
> ---
>   meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> index 75b3d9e8c..989ec5413 100644
> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> @@ -73,6 +73,7 @@ CACHED_CONFIGUREVARS = " \
>       lt_cv_shlibpath_overrides_runpath=yes \
>       ac_cv_path_UNAMEPROG=${base_bindir}/uname \
>       ac_cv_path_PSPROG=${base_bindir}/ps \
> +    ac_cv_ps_flags="-e" \
>       ac_cv_file__etc_printcap=no \
>       NETSNMP_CONFIGURE_OPTIONS= \
>   "
Jeremy Puhlman July 9, 2024, 1:47 a.m. UTC | #3
On 7/8/2024 6:00 PM, Khem Raj wrote:
> On Mon, Jul 8, 2024 at 5:41 PM Jeremy Puhlman via
> lists.openembedded.org <jpuhlman=mvista.com@lists.openembedded.org>
> wrote:
>> From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>
>>
>> The value the configure script uses is picked up
>> from the host machine ps, and there are cases when
>> the flag selection can be different. Which would
>> break reproducablity between builds on different
>> machines.
>>
>> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
>> ---
>>   meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>> index 75b3d9e8c..989ec5413 100644
>> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>> @@ -73,6 +73,7 @@ CACHED_CONFIGUREVARS = " \
>>       lt_cv_shlibpath_overrides_runpath=yes \
>>       ac_cv_path_UNAMEPROG=${base_bindir}/uname \
>>       ac_cv_path_PSPROG=${base_bindir}/ps \
>> +    ac_cv_ps_flags="-e" \
> While this change seems ok, I wonder if then we also need to ensure
> that procps provided ps utility is rdepend'ed upon too.
All the usage there is to see if snmpd is actually running. Any value 
that works for all of them would be reasonable. I thought the
assumption was that busybox was always on the system and busybox ps 
accepts -e with an output that should work. Probably
don't need the rdepend, If base busybox is still assumed.

>>       ac_cv_file__etc_printcap=no \
>>       NETSNMP_CONFIGURE_OPTIONS= \
>>   "
>> --
>> 2.35.7
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#111270): https://lists.openembedded.org/g/openembedded-devel/message/111270
>> Mute This Topic: https://lists.openembedded.org/mt/107114904/1997914
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Khem Raj July 9, 2024, 2:20 a.m. UTC | #4
Hi Jeremy

So it seems only needed during build it seems ?

On Mon, Jul 8, 2024 at 6:47 PM Jeremy Puhlman <jpuhlman@mvista.com> wrote:

>
>
> On 7/8/2024 6:00 PM, Khem Raj wrote:
> > On Mon, Jul 8, 2024 at 5:41 PM Jeremy Puhlman via
> > lists.openembedded.org <jpuhlman=mvista.com@lists.openembedded.org>
> > wrote:
> >> From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>
> >>
> >> The value the configure script uses is picked up
> >> from the host machine ps, and there are cases when
> >> the flag selection can be different. Which would
> >> break reproducablity between builds on different
> >> machines.
> >>
> >> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
> >> ---
> >>   meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 +
> >>   1 file changed, 1 insertion(+)
> >>
> >> diff --git a/meta-networking/recipes-protocols/net-snmp/
> net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/
> net-snmp_5.9.4.bb
> >> index 75b3d9e8c..989ec5413 100644
> >> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> >> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
> >> @@ -73,6 +73,7 @@ CACHED_CONFIGUREVARS = " \
> >>       lt_cv_shlibpath_overrides_runpath=yes \
> >>       ac_cv_path_UNAMEPROG=${base_bindir}/uname \
> >>       ac_cv_path_PSPROG=${base_bindir}/ps \
> >> +    ac_cv_ps_flags="-e" \
> > While this change seems ok, I wonder if then we also need to ensure
> > that procps provided ps utility is rdepend'ed upon too.
> All the usage there is to see if snmpd is actually running. Any value
> that works for all of them would be reasonable. I thought the
> assumption was that busybox was always on the system and busybox ps
> accepts -e with an output that should work. Probably
> don't need the rdepend, If base busybox is still assumed.
>
> >>       ac_cv_file__etc_printcap=no \
> >>       NETSNMP_CONFIGURE_OPTIONS= \
> >>   "
> >> --
> >> 2.35.7
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#111270):
> https://lists.openembedded.org/g/openembedded-devel/message/111270
> >> Mute This Topic: https://lists.openembedded.org/mt/107114904/1997914
> >> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub
> [raj.khem@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
>
> --
> Jeremy Puhlman
> jpuhlman@mvista.com
>
>
Jeremy Puhlman July 9, 2024, 3:27 a.m. UTC | #5
On 7/8/2024 7:20 PM, Khem Raj wrote:
> Hi Jeremy
>
> So it seems only needed during build it seems ?
>
No the value is used in the /usr/bin/net-snmp-create-v3-user script that 
ends up in the
devel package. The value is checked during the build, but used on the 
system.

The value is placed here:
if @PSCMD@ | egrep ' snmpd *$' > /dev/null 2>&1 ; then
     echo "Apparently at least one snmpd demon is already running."
     echo "You must stop them in order to use this command."
     exit 1
fi


Where PSCMD is concatinated by PSPROG, already set in the cached values and
ac_cv_ps_flags which the patch adds. The configure script attempts to 
ascertain
what the correct flags are via:

if test "`($PSPROG -e 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" = 
"ps" ; then
     ac_cv_ps_flags="-e"
elif test "`($PSPROG -el 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" 
= "ps" ; then
     ac_cv_ps_flags="-el"
elif test "`($PSPROG acx 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" 
= "ps" ; then
     ac_cv_ps_flags="acx"
elif test "`($PSPROG -acx 2>&1) | $EGREP ' (ps) *$' | awk '{print 
$NF}'`" = "ps" ; then
     ac_cv_ps_flags="-acx"
elif test "`($PSPROG -o pid,tt,state,time,ucomm 2>&1) | $EGREP ' ps *$' 
| awk '{print $NF}'`" = "ps" ; then
     ac_cv_ps_flags="-o pid,tt,state,time,ucomm"
elif test "`($PSPROG ax 2>&1) | $EGREP ' (ps) *$' | awk '{print $NF}'`" 
= "ps" ; then
     ac_cv_ps_flags="ax"
elif test "x$PARTIALTARGETOS" = "xcygwin"; then
     ac_cv_ps_flags="-e"
elif test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = 
"xmingw32msvc"; then
     ac_cv_ps_flags="-e"
else
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to 
determine valid ps flags...  defaulting..." >&5
printf "%s\n" "$as_me: WARNING: Unable to determine valid ps flags...  
defaulting..." >&2;}



However the value ends up in the script. We got a wierd build error 
where a sshared state was built and got -e
and the mulitlib version got auf or something similar, which caused the 
scripts to conflict. For the sake of
reproducablity, we should set the value to one value so it is the same 
for every build.

> On Mon, Jul 8, 2024 at 6:47 PM Jeremy Puhlman <jpuhlman@mvista.com> wrote:
>
>
>
>     On 7/8/2024 6:00 PM, Khem Raj wrote:
>     > On Mon, Jul 8, 2024 at 5:41 PM Jeremy Puhlman via
>     > lists.openembedded.org <http://lists.openembedded.org>
>     <jpuhlman=mvista.com@lists.openembedded.org>
>     > wrote:
>     >> From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>
>     >>
>     >> The value the configure script uses is picked up
>     >> from the host machine ps, and there are cases when
>     >> the flag selection can be different. Which would
>     >> break reproducablity between builds on different
>     >> machines.
>     >>
>     >> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
>     >> ---
>     >>   meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>     <http://net-snmp_5.9.4.bb> | 1 +
>     >>   1 file changed, 1 insertion(+)
>     >>
>     >> diff --git
>     a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>     <http://net-snmp_5.9.4.bb>
>     b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>     <http://net-snmp_5.9.4.bb>
>     >> index 75b3d9e8c..989ec5413 100644
>     >> ---
>     a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>     <http://net-snmp_5.9.4.bb>
>     >> +++
>     b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
>     <http://net-snmp_5.9.4.bb>
>     >> @@ -73,6 +73,7 @@ CACHED_CONFIGUREVARS = " \
>     >>       lt_cv_shlibpath_overrides_runpath=yes \
>     >>       ac_cv_path_UNAMEPROG=${base_bindir}/uname \
>     >>       ac_cv_path_PSPROG=${base_bindir}/ps \
>     >> +    ac_cv_ps_flags="-e" \
>     > While this change seems ok, I wonder if then we also need to ensure
>     > that procps provided ps utility is rdepend'ed upon too.
>     All the usage there is to see if snmpd is actually running. Any value
>     that works for all of them would be reasonable. I thought the
>     assumption was that busybox was always on the system and busybox ps
>     accepts -e with an output that should work. Probably
>     don't need the rdepend, If base busybox is still assumed.
>
>     >>       ac_cv_file__etc_printcap=no \
>     >>       NETSNMP_CONFIGURE_OPTIONS= \
>     >>   "
>     >> --
>     >> 2.35.7
>     >>
>     >>
>     >> -=-=-=-=-=-=-=-=-=-=-=-
>     >> Links: You receive all messages sent to this group.
>     >> View/Reply Online (#111270):
>     https://lists.openembedded.org/g/openembedded-devel/message/111270
>     >> Mute This Topic:
>     https://lists.openembedded.org/mt/107114904/1997914
>     >> Group Owner: openembedded-devel+owner@lists.openembedded.org
>     <mailto:openembedded-devel%2Bowner@lists.openembedded.org>
>     >> Unsubscribe:
>     https://lists.openembedded.org/g/openembedded-devel/unsub
>     [raj.khem@gmail.com]
>     >> -=-=-=-=-=-=-=-=-=-=-=-
>     >>
>
>     -- 
>     Jeremy Puhlman
>     jpuhlman@mvista.com
>
diff mbox series

Patch

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
index 75b3d9e8c..989ec5413 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb
@@ -73,6 +73,7 @@  CACHED_CONFIGUREVARS = " \
     lt_cv_shlibpath_overrides_runpath=yes \
     ac_cv_path_UNAMEPROG=${base_bindir}/uname \
     ac_cv_path_PSPROG=${base_bindir}/ps \
+    ac_cv_ps_flags="-e" \
     ac_cv_file__etc_printcap=no \
     NETSNMP_CONFIGURE_OPTIONS= \
 "