ifquery fails with bad file descriptor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
Fix Released
|
Medium
|
Chris J Arges | ||
Precise |
Fix Released
|
Medium
|
Chris J Arges | ||
Quantal |
Fix Released
|
Medium
|
Chris J Arges | ||
Raring |
Fix Released
|
Medium
|
Chris J Arges |
Bug Description
== Begin SRU ==
[Impact]
This bug is a regression of the fix applied under bug 1160490.
The bug is that 'ifquery --list' will try to obtain a lock on a file in /run, which will fail with an error message of 'Bad file descriptor'.
The changes applied here are a backport of upstream fix fb3055c2c4f0 [1].
[Test Case]
Ideally both the test case from bug 1160490 [2] and the following test case should be done.
$ sudo ifquery --list --allow auto
lo
eth0
$ ifquery --list --allow auto
lo
eth0
Success is a list of the 'auto' interfaces that in /etc/network/
Additionally, verify that you can query something other than the default interfaces file as root and non-root.
$ ( echo "auto eth1"; echo "iface eth1 inet dhcp"; ) > /tmp/my.interfaces
$ sudo ifquery --list --allow auto --interfaces=
lo
eth1
$ ifquery --list --allow auto --interfaces=
lo
eth1
the 'lo' output is expected as 'lo' is automatically auto. Failure here would be the same 'failed to lock lockfile' or non-zero exit.
It also surely wouldn't hurt to do:
$ sudo ifdown eth0; sudo ifup eth0
Just to make sure that functions.
[Regression Potential]
* (from bug 1160490) This fix backports a change from upstream ifupdown. Instead of locking a statefile it locks a lockfile.
* the change here is very trivial. It chooses to not fail on failure to get lockfile if the operation is 'no_act' (see [1]).
[1] http://
[2] https:/
=== End SRU ===
$ sudo ifquery --list --allow auto; echo $?;
ifquery: failed to lock lockfile /run/network/
1
This seems possibly quite serious as /etc/network/
This reproduces on a fresh saucy image with serial=20130916.
Also interesting, possibly related and possibly a bug in and of itself:
$ cp /etc/network/
$ sudo ifquery --interfaces /tmp/interfaces --list --allow=auto
ifquery: failed to lock lockfile /run/network/
Seems odd that it would do anything with /run/network/
For reference, on raring instance as non-root:
$ ifquery --list --allow auto
lo
eth0
Related bugs:
* bug 1160490: race condition updating statefile
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: ifupdown 0.7.44ubuntu2
ProcVersionSign
Uname: Linux 3.11.0-7-generic x86_64
ApportVersion: 2.12.1-0ubuntu4
Architecture: amd64
Date: Mon Sep 16 14:02:41 2013
Ec2AMI: ami-000004dd
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.tiny
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
MarkForUpload: True
ProcEnviron:
TERM=screen
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ifupdown
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | added: regression-release |
Changed in ifupdown (Ubuntu): | |
assignee: | nobody → Chris J Arges (arges) |
description: | updated |
description: | updated |
tags: | added: verification-done-raring |
some info, on system this died on: upstart/ network- interface- eth0.log /www.isc. org/software/ dhcp/
$ cat /var/log/
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
Listening on LPF/eth0/ fa:16:3e: 3b:18:74 fa:16:3e: 3b:18:74
Sending on LPF/eth0/
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x5940a96d)
DHCPREQUEST of 10.55.60.126 on eth0 to 255.255.255.255 port 67 (xid=0x5940a96d)
DHCPOFFER of 10.55.60.126 from 10.55.60.1
DHCPACK of 10.55.60.126 from 10.55.60.1
bound to 10.55.60.126 -- renewal in 55 seconds.
ie, no mention of failure there.