* [Buildroot] [PATCH 1/2] netsnmp: fix stop and restart actions in init script
@ 2011-06-15 15:47 Luca Ceresoli
2011-06-15 15:47 ` [Buildroot] [PATCH 2/2] netsnmp: allow not to install MIB files Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
0 siblings, 2 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-15 15:47 UTC (permalink / raw)
To: buildroot
/etc/init.d/S59snmpd stop (and restart) currently fail if either snmpd or
snmptrapd are not running.
This is because start-stop-daemon -K returns nonzero if the process to be
killed is not running, and this causes the whole script to fail because it runs
under 'set -e'.
This may not be noticed if only the last start-stop-daemon fails, but this is
in general wrong. It would also cause a failure in other scripts that execute
S59snmpd and check the return value.
Adding the --oknodo (-o) option to start-stop-daemon fixes this.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Weird enough, in the current code the ssd_oknodo variable is first set, then
cleared. git log does not help to understand why, but this looks really
useless.
This is why I removed a line, instead of adding one.
package/netsnmp/S59snmpd | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/package/netsnmp/S59snmpd b/package/netsnmp/S59snmpd
index f65317a..5df4b85 100755
--- a/package/netsnmp/S59snmpd
+++ b/package/netsnmp/S59snmpd
@@ -29,7 +29,6 @@ TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
ssd_oknodo="-o"
-ssd_oknodo=""
# Cd to / before starting any daemons.
cd /
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 2/2] netsnmp: allow not to install MIB files
2011-06-15 15:47 [Buildroot] [PATCH 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
@ 2011-06-15 15:47 ` Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
1 sibling, 0 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-15 15:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
package/netsnmp/Config.in | 7 +++++++
package/netsnmp/netsnmp.mk | 4 ++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index 5a3e9aa..2aa537e 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -6,3 +6,10 @@ config BR2_PACKAGE_NETSNMP
http://net-snmp.sourceforge.net/
+config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
+ bool "Install MIB files on target"
+ default y
+ depends on BR2_PACKAGE_NETSNMP
+ help
+ The net-snmp package contains a selection of MIB files.
+ Say yes if you want those MIB files installed on the target.
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 5704327..4eae544 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -43,6 +43,10 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
NETSNMP_CONF_OPT += --disable-manuals
endif
+ifneq ($(BR2_PACKAGE_NETSNMP_INSTALL_MIBS),y)
+ NETSNMP_CONF_OPT += --disable-mibs
+endif
+
# Remove IPv6 MIBs if there's no IPv6
ifneq ($(BR2_INET_IPV6),y)
define NETSNMP_REMOVE_MIBS_IPV6
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 0/3] netsnmp improvements
2011-06-15 15:47 [Buildroot] [PATCH 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-06-15 15:47 ` [Buildroot] [PATCH 2/2] netsnmp: allow not to install MIB files Luca Ceresoli
@ 2011-06-16 15:27 ` Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 1/3] netsnmp: fix stop and restart actions in init script Luca Ceresoli
` (4 more replies)
1 sibling, 5 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-16 15:27 UTC (permalink / raw)
To: buildroot
Hi,
please ignore the two patches I sent yesterday for netsnmp. Patch 2 introduced
an annoying series of warnings, as net-snmp requires the MIB files to be
installed if the MIB loading code is enabled.
The present patch series addresses this issue correctly, allowing in addition
to disable the MIB loading code.
Patch 1 is unchanged.
Luca
Luca Ceresoli (3):
netsnmp: fix stop and restart actions in init script
netsnmp: allow to disable MIB loading code
netsnmp: allow not to install MIB files
package/netsnmp/Config.in | 15 +++++++++++++++
package/netsnmp/S59snmpd | 1 -
package/netsnmp/netsnmp.mk | 8 ++++++++
3 files changed, 23 insertions(+), 1 deletions(-)
--
1.7.4.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 1/3] netsnmp: fix stop and restart actions in init script
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
@ 2011-06-16 15:27 ` Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 2/3] netsnmp: allow to disable MIB loading code Luca Ceresoli
` (3 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-16 15:27 UTC (permalink / raw)
To: buildroot
/etc/init.d/S59snmpd stop (and restart) currently fail if either snmpd or
snmptrapd are not running.
This is because start-stop-daemon -K returns nonzero if the process to be
killed is not running, and this causes the whole script to fail because it runs
under 'set -e'.
This may not be noticed if only the last start-stop-daemon fails, but this is
in general wrong. It would also cause a failure in other scripts that execute
S59snmpd and check the return value.
Adding the --oknodo (-o) option to start-stop-daemon fixes this.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Changes in v2: none.
package/netsnmp/S59snmpd | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/package/netsnmp/S59snmpd b/package/netsnmp/S59snmpd
index f65317a..5df4b85 100755
--- a/package/netsnmp/S59snmpd
+++ b/package/netsnmp/S59snmpd
@@ -29,7 +29,6 @@ TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
ssd_oknodo="-o"
-ssd_oknodo=""
# Cd to / before starting any daemons.
cd /
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 2/3] netsnmp: allow to disable MIB loading code
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 1/3] netsnmp: fix stop and restart actions in init script Luca Ceresoli
@ 2011-06-16 15:27 ` Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files Luca Ceresoli
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-16 15:27 UTC (permalink / raw)
To: buildroot
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Changes in v2:
- this patch is new in v2.
package/netsnmp/Config.in | 7 +++++++
package/netsnmp/netsnmp.mk | 4 ++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index 5a3e9aa..6f88b03 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -6,3 +6,10 @@ config BR2_PACKAGE_NETSNMP
http://net-snmp.sourceforge.net/
+config BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
+ bool "Enable MIB loading code"
+ default y
+ depends on BR2_PACKAGE_NETSNMP
+ help
+ Include code that parses and manipulates the mib files.
+
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 5704327..c0e631b 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -43,6 +43,10 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
NETSNMP_CONF_OPT += --disable-manuals
endif
+ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING),y)
+ NETSNMP_CONF_OPT += --disable-mib-loading
+endif
+
# Remove IPv6 MIBs if there's no IPv6
ifneq ($(BR2_INET_IPV6),y)
define NETSNMP_REMOVE_MIBS_IPV6
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 1/3] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 2/3] netsnmp: allow to disable MIB loading code Luca Ceresoli
@ 2011-06-16 15:27 ` Luca Ceresoli
2011-08-30 17:50 ` Yann E. MORIN
2011-08-30 17:39 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Gustavo Zacarias
2011-08-31 19:46 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
4 siblings, 1 reply; 15+ messages in thread
From: Luca Ceresoli @ 2011-06-16 15:27 UTC (permalink / raw)
To: buildroot
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Changes in v2:
- MIB installation is forcibly enabled with the MIB loading code; otherwise
net-snmp would loudly flood the console for missing MIBs.
package/netsnmp/Config.in | 8 ++++++++
package/netsnmp/netsnmp.mk | 4 ++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index 6f88b03..a6a768c 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -10,6 +10,14 @@ config BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
bool "Enable MIB loading code"
default y
depends on BR2_PACKAGE_NETSNMP
+ select BR2_PACKAGE_NETSNMP_INSTALL_MIBS
help
Include code that parses and manipulates the mib files.
+config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
+ bool "Install MIB files on target"
+ default y
+ depends on BR2_PACKAGE_NETSNMP
+ help
+ The net-snmp package contains a selection of MIB files.
+ Say yes if you want those MIB files installed on the target.
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index c0e631b..09111bf 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -47,6 +47,10 @@ ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING),y)
NETSNMP_CONF_OPT += --disable-mib-loading
endif
+ifneq ($(BR2_PACKAGE_NETSNMP_INSTALL_MIBS),y)
+ NETSNMP_CONF_OPT += --disable-mibs
+endif
+
# Remove IPv6 MIBs if there's no IPv6
ifneq ($(BR2_INET_IPV6),y)
define NETSNMP_REMOVE_MIBS_IPV6
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 0/3] netsnmp improvements
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
` (2 preceding siblings ...)
2011-06-16 15:27 ` [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files Luca Ceresoli
@ 2011-08-30 17:39 ` Gustavo Zacarias
2011-08-31 19:46 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
4 siblings, 0 replies; 15+ messages in thread
From: Gustavo Zacarias @ 2011-08-30 17:39 UTC (permalink / raw)
To: buildroot
On Thu, 16 Jun 2011 17:27:10 +0200, Luca Ceresoli wrote:
> Hi,
>
> please ignore the two patches I sent yesterday for netsnmp. Patch 2
> introduced
> an annoying series of warnings, as net-snmp requires the MIB files to
> be
> installed if the MIB loading code is enabled.
>
> The present patch series addresses this issue correctly, allowing in
> addition
> to disable the MIB loading code.
>
> Patch 1 is unchanged.
>
> Luca
>
>
> Luca Ceresoli (3):
> netsnmp: fix stop and restart actions in init script
> netsnmp: allow to disable MIB loading code
> netsnmp: allow not to install MIB files
ACK in principle.
However is there any useful scenario where MIB loading code is disabled
and we want to install MIB files?
I think both options could be condensed into a single one if not.
Regards.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files
2011-06-16 15:27 ` [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files Luca Ceresoli
@ 2011-08-30 17:50 ` Yann E. MORIN
2011-08-31 12:48 ` Luca Ceresoli
0 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2011-08-30 17:50 UTC (permalink / raw)
To: buildroot
Luca, All,
On Thursday 16 June 2011 17:27:13 Luca Ceresoli wrote:
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> Changes in v2:
> - MIB installation is forcibly enabled with the MIB loading code; otherwise
> net-snmp would loudly flood the console for missing MIBs.
>
> package/netsnmp/Config.in | 8 ++++++++
> package/netsnmp/netsnmp.mk | 4 ++++
> 2 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
> index 6f88b03..a6a768c 100644
> --- a/package/netsnmp/Config.in
> +++ b/package/netsnmp/Config.in
> @@ -10,6 +10,14 @@ config BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
> bool "Enable MIB loading code"
> default y
> depends on BR2_PACKAGE_NETSNMP
> + select BR2_PACKAGE_NETSNMP_INSTALL_MIBS
Well, I'd do the other way around: if MIB files are to be installed, then
we need to be able to load them, so I'd do either:
config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
depends on BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
Or:
config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
depends on BR2_PACKAGE_NETSNMP
select BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
After all, maybe the user wants to be able to load MIBs, but will provide
its own set, and not the bundled ones, so we should have the possibility
to enable MIB loading, and not install the bundled ones. But if we install
those, we need to be able to load them.
> help
> Include code that parses and manipulates the mib files.
>
> +config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
> + bool "Install MIB files on target"
> + default y
> + depends on BR2_PACKAGE_NETSNMP
> + help
> + The net-snmp package contains a selection of MIB files.
> + Say yes if you want those MIB files installed on the target.
> diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
> index c0e631b..09111bf 100644
> --- a/package/netsnmp/netsnmp.mk
> +++ b/package/netsnmp/netsnmp.mk
> @@ -47,6 +47,10 @@ ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING),y)
> NETSNMP_CONF_OPT += --disable-mib-loading
> endif
>
> +ifneq ($(BR2_PACKAGE_NETSNMP_INSTALL_MIBS),y)
> + NETSNMP_CONF_OPT += --disable-mibs
> +endif
> +
> # Remove IPv6 MIBs if there's no IPv6
> ifneq ($(BR2_INET_IPV6),y)
> define NETSNMP_REMOVE_MIBS_IPV6
>
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files
2011-08-30 17:50 ` Yann E. MORIN
@ 2011-08-31 12:48 ` Luca Ceresoli
2011-08-31 13:33 ` Yann E. MORIN
0 siblings, 1 reply; 15+ messages in thread
From: Luca Ceresoli @ 2011-08-31 12:48 UTC (permalink / raw)
To: buildroot
Yann E. MORIN wrote:
> Luca, All,
>
> On Thursday 16 June 2011 17:27:13 Luca Ceresoli wrote:
>> Signed-off-by: Luca Ceresoli<luca@lucaceresoli.net>
>> ---
>> Changes in v2:
>> - MIB installation is forcibly enabled with the MIB loading code; otherwise
>> net-snmp would loudly flood the console for missing MIBs.
>>
>> package/netsnmp/Config.in | 8 ++++++++
>> package/netsnmp/netsnmp.mk | 4 ++++
>> 2 files changed, 12 insertions(+), 0 deletions(-)
>>
>> diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
>> index 6f88b03..a6a768c 100644
>> --- a/package/netsnmp/Config.in
>> +++ b/package/netsnmp/Config.in
>> @@ -10,6 +10,14 @@ config BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
>> bool "Enable MIB loading code"
>> default y
>> depends on BR2_PACKAGE_NETSNMP
>> + select BR2_PACKAGE_NETSNMP_INSTALL_MIBS
>
> Well, I'd do the other way around: if MIB files are to be installed, then
> we need to be able to load them, so I'd do either:
>
> config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
> depends on BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
>
> Or:
>
> config BR2_PACKAGE_NETSNMP_INSTALL_MIBS
> depends on BR2_PACKAGE_NETSNMP
> select BR2_PACKAGE_NETSNMP_ENABLE_MIB_LOADING
The problem is net-snmp wants the MIBs installed when the MIB loading
code is enabled, so this combination would be very annoying.
The use case you think about is that the user wants to provide his own
MIB files. If he did, he would need to install also the base MIBs (the
same installed by net-snmp), because it is impossible to load any MIB
node without having the definition for the parent MIB nodes.
So I think this use case would be so limited that it's not worth
supporting it. At least not until anybody has this need.
So I think Gustavo's proposal is best: one option only to either enable
both features or disable both.
If you agree, I'll prepare a new patchset.
Luca
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files
2011-08-31 12:48 ` Luca Ceresoli
@ 2011-08-31 13:33 ` Yann E. MORIN
0 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2011-08-31 13:33 UTC (permalink / raw)
To: buildroot
Luca, Gustavo, All,
On Wednesday 31 August 2011 14:48:16 Luca Ceresoli wrote:
> Yann E. MORIN wrote:
> > Well, I'd do the other way around: if MIB files are to be installed, then
> > we need to be able to load them, so I'd do either:
[--SNIP--]
> The problem is net-snmp wants the MIBs installed when the MIB loading
> code is enabled, so this combination would be very annoying.
Ah, so this is a limitation of the net-snmp build system... OK.
> The use case you think about is that the user wants to provide his own
> MIB files. If he did, he would need to install also the base MIBs (the
> same installed by net-snmp), because it is impossible to load any MIB
> node without having the definition for the parent MIB nodes.
Yes, but I was merely thinking about using a whole set of altenative MIBs.
> So I think this use case would be so limited that it's not worth
> supporting it. At least not until anybody has this need.
Granted.
> So I think Gustavo's proposal is best: one option only to either enable
> both features or disable both.
> If you agree, I'll prepare a new patchset.
Yes, that's good for me. I was just saying that, in my point of view, the
dependency/select was in reverse order from a purely-logical point of view.
But your answer clarifies this, and Gustavoz' suggestion is even simpler,
and as you said, the alternative would be very seldom used, if at all, so
a single option perfectly makes sense. The user would then be free to
provide/overide its own set with the custom script that is run just prior
to building the images.
Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
` (3 preceding siblings ...)
2011-08-30 17:39 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Gustavo Zacarias
@ 2011-08-31 19:46 ` Luca Ceresoli
2011-08-31 19:46 ` [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code Luca Ceresoli
2011-09-11 21:09 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Peter Korsgaard
4 siblings, 2 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-08-31 19:46 UTC (permalink / raw)
To: buildroot
/etc/init.d/S59snmpd stop (and restart) currently fail if either snmpd or
snmptrapd are not running.
This is because start-stop-daemon -K returns nonzero if the process to be
killed is not running, and this causes the whole script to fail because it runs
under 'set -e'.
This may not be noticed if only the last start-stop-daemon fails, but this is
in general wrong. It would also cause a failure in other scripts that execute
S59snmpd and check the return value.
Adding the --oknodo (-o) option to start-stop-daemon fixes this.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Changes in v2: none.
Changes in v3: none.
package/netsnmp/S59snmpd | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/package/netsnmp/S59snmpd b/package/netsnmp/S59snmpd
index f65317a..5df4b85 100755
--- a/package/netsnmp/S59snmpd
+++ b/package/netsnmp/S59snmpd
@@ -29,7 +29,6 @@ TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
ssd_oknodo="-o"
-ssd_oknodo=""
# Cd to / before starting any daemons.
cd /
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code
2011-08-31 19:46 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
@ 2011-08-31 19:46 ` Luca Ceresoli
2011-08-31 20:38 ` Yann E. MORIN
2011-09-11 21:10 ` Peter Korsgaard
2011-09-11 21:09 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Peter Korsgaard
1 sibling, 2 replies; 15+ messages in thread
From: Luca Ceresoli @ 2011-08-31 19:46 UTC (permalink / raw)
To: buildroot
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Changes in v2:
- MIB installation is forcibly enabled with the MIB loading code; otherwise
net-snmp would loudly flood the console for missing MIBs.
Changes in v3:
- Join in a unique option the choice of not installing MIB files and not
enabling MIB loading code. The mixed cases were either problematical or
unlikely to be useful. This is per the discussion in
http://lists.busybox.net/pipermail/buildroot/2011-August/045256.html
package/netsnmp/Config.in | 8 ++++++++
package/netsnmp/netsnmp.mk | 5 +++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index 5a3e9aa..431be2d 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -6,3 +6,11 @@ config BR2_PACKAGE_NETSNMP
http://net-snmp.sourceforge.net/
+config BR2_PACKAGE_NETSNMP_ENABLE_MIBS
+ bool "Install MIB files on target and enable MIB loading code"
+ default y
+ depends on BR2_PACKAGE_NETSNMP
+ help
+ The net-snmp package contains a selection of MIB files.
+ Say yes if you want those MIB files installed on the target
+ and enable the code that parses the MIB files.
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 5704327..cef6583 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -43,6 +43,11 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
NETSNMP_CONF_OPT += --disable-manuals
endif
+ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
+ NETSNMP_CONF_OPT += --disable-mib-loading
+ NETSNMP_CONF_OPT += --disable-mibs
+endif
+
# Remove IPv6 MIBs if there's no IPv6
ifneq ($(BR2_INET_IPV6),y)
define NETSNMP_REMOVE_MIBS_IPV6
--
1.7.4.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code
2011-08-31 19:46 ` [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code Luca Ceresoli
@ 2011-08-31 20:38 ` Yann E. MORIN
2011-09-11 21:10 ` Peter Korsgaard
1 sibling, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2011-08-31 20:38 UTC (permalink / raw)
To: buildroot
On Wednesday 31 August 2011 21:46:39 Luca Ceresoli wrote:
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
> ---
> Changes in v2:
> - MIB installation is forcibly enabled with the MIB loading code; otherwise
> net-snmp would loudly flood the console for missing MIBs.
>
> Changes in v3:
> - Join in a unique option the choice of not installing MIB files and not
> enabling MIB loading code. The mixed cases were either problematical or
> unlikely to be useful. This is per the discussion in
> http://lists.busybox.net/pipermail/buildroot/2011-August/045256.html
>
> package/netsnmp/Config.in | 8 ++++++++
> package/netsnmp/netsnmp.mk | 5 +++++
> 2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
> index 5a3e9aa..431be2d 100644
> --- a/package/netsnmp/Config.in
> +++ b/package/netsnmp/Config.in
> @@ -6,3 +6,11 @@ config BR2_PACKAGE_NETSNMP
>
> http://net-snmp.sourceforge.net/
>
> +config BR2_PACKAGE_NETSNMP_ENABLE_MIBS
> + bool "Install MIB files on target and enable MIB loading code"
> + default y
> + depends on BR2_PACKAGE_NETSNMP
> + help
> + The net-snmp package contains a selection of MIB files.
> + Say yes if you want those MIB files installed on the target
> + and enable the code that parses the MIB files.
> diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
> index 5704327..cef6583 100644
> --- a/package/netsnmp/netsnmp.mk
> +++ b/package/netsnmp/netsnmp.mk
> @@ -43,6 +43,11 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
> NETSNMP_CONF_OPT += --disable-manuals
> endif
>
> +ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
> + NETSNMP_CONF_OPT += --disable-mib-loading
> + NETSNMP_CONF_OPT += --disable-mibs
> +endif
> +
> # Remove IPv6 MIBs if there's no IPv6
> ifneq ($(BR2_INET_IPV6),y)
> define NETSNMP_REMOVE_MIBS_IPV6
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script
2011-08-31 19:46 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-08-31 19:46 ` [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code Luca Ceresoli
@ 2011-09-11 21:09 ` Peter Korsgaard
1 sibling, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2011-09-11 21:09 UTC (permalink / raw)
To: buildroot
>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:
Luca> /etc/init.d/S59snmpd stop (and restart) currently fail if either
Luca> snmpd or snmptrapd are not running. This is because
Luca> start-stop-daemon -K returns nonzero if the process to be killed
Luca> is not running, and this causes the whole script to fail because
Luca> it runs under 'set -e'.
Committed. thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code
2011-08-31 19:46 ` [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code Luca Ceresoli
2011-08-31 20:38 ` Yann E. MORIN
@ 2011-09-11 21:10 ` Peter Korsgaard
1 sibling, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2011-09-11 21:10 UTC (permalink / raw)
To: buildroot
>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:
Luca> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-09-11 21:10 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 15:47 [Buildroot] [PATCH 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-06-15 15:47 ` [Buildroot] [PATCH 2/2] netsnmp: allow not to install MIB files Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 1/3] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 2/3] netsnmp: allow to disable MIB loading code Luca Ceresoli
2011-06-16 15:27 ` [Buildroot] [PATCH v2 3/3] netsnmp: allow not to install MIB files Luca Ceresoli
2011-08-30 17:50 ` Yann E. MORIN
2011-08-31 12:48 ` Luca Ceresoli
2011-08-31 13:33 ` Yann E. MORIN
2011-08-30 17:39 ` [Buildroot] [PATCH v2 0/3] netsnmp improvements Gustavo Zacarias
2011-08-31 19:46 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Luca Ceresoli
2011-08-31 19:46 ` [Buildroot] [PATCH v3 2/2] netsnmp: allow to disable MIB files installation and MIB loading code Luca Ceresoli
2011-08-31 20:38 ` Yann E. MORIN
2011-09-11 21:10 ` Peter Korsgaard
2011-09-11 21:09 ` [Buildroot] [PATCH v3 1/2] netsnmp: fix stop and restart actions in init script Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox