network fails to read /proc/net/dev

Bug #1203601 reported by Bob Ballister
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Low
Unassigned

Bug Description

I finally figured out why the network display fails on one of my servers. It is on Ubuntu 12.04.02

Apparently piping /proc/net/dev to the bash loop transmits does not transmit the entire contents for some reason.

This is what happens when this simple bash script is run. It only prints out eth1 when there is also an eth0 lower on the list.

while read line; do
     printf "${line}\n"
done < /proc/net/dev

Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0

If I pipe /proc/net/dev to a file and then pipe the file in the while read loop, then everything works perfectly.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks for this report and the information.

Can you attach a patch that solves your problem? I'll review it and apply if it makes sense.

Also, have you tried manually specifying the interface that you want to monitor? You should be able to set:

MONITORED_NETWORK=eth1

in your ~/.byobu/statusrc?

Changed in byobu:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Bob Ballister (78luphr0rnk2nuqimstywepozxn9kl19tqh0tx66b5dki1xxsh5mkz9gl21a5rlwfnr8jn6ln0m3jxne2k9x1ohg-launchpad) wrote :

Yes I tried specifying the network already. It doesn't matter though because the contents are corrupted when read by bash for some odd reason.

I am not sure how to make a patch for bazaar. It is a very simple change.

I put this right before the while loop.

cat /proc/net/dev > "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/netdev"

And put this at the end of the while loop.

done < "$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/netdev"

If you want I can give you access to the server. My lease on it will be expiring on August 7.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Committed revision 2198.

Changed in byobu:
status: Incomplete → In Progress
status: In Progress → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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