read() builtin doesn't work with /proc files containing only an integer value

Bug #598275 reported by Micah Stetson
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
dash (Debian)
Confirmed
Unknown
dash (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: munin

Ubuntu 10.04 LTS, munin-node 1.4.4-1ubuntu1. On my newly installed Lucid server, Munin's fw_conntrack plugin reports the "critical" number of network connects as 5 or 6. This means that I get constant alerts about having too many network connections. I think this is actually caused by a bug in dash's built-in read command. Fw_conntrack gets its max connection number by reading /proc/sys/net/ipv4/ip_conntrack_max or /proc/sys/net/ipv4/netfilter/ip_conntrack_max around line 110 of /usr/share/munin/plugins/fw_conntrack. Like this:

    read MAX < /proc/sys/net/ipv4/netfilter/ip_conntrack_max

If I run this in bash:

    bash# read MAX < /proc/sys/net/ipv4/netfilter/ip_conntrack_max && echo good: $MAX || echo bad: $MAX
    good: 7852

but in dash:

    dash# read MAX < /proc/sys/net/ipv4/netfilter/ip_conntrack_max && echo good: $MAX || echo bad: $MAX
    bad: 7

So dash's read is failing AND setting $MAX. I imagine this is a bug in dash, but fw_conntrack is also ignoring the fact that read is returning failure.

Changing fw_conntrack's #! line to #!/bin/bash works around the problem, but I wouldn't call that a fix.

Micah Stetson (mstetson)
description: updated
Chuck Short (zulcss)
affects: munin (Ubuntu) → dash (Ubuntu)
Changed in dash (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Changed in dash (Debian):
status: Unknown → Confirmed
summary: - munin-node fw_conntrack plugin reports incorrect critical threshold
+ read() builtin doesn't work with /proc files containing only an integer
+ value
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.