can't use /sbin/ifconfig
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logwatch (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Michał Małoszewski | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
On 20.04, when I install the logwatch package and try to get the activity report by typing:
$ sudo logwatch --detail Low --range today --service all --output stdout
I see the message:
can't use /sbin/ifconfig -a: No such file or directory at /usr/share/
The situation is unfortunate for users who want to display the activity report.
The problem affects Focal. No other releases are affected - I have checked it.
[Test Plan]
** Reproduction **
Make a container for testing:
$ lxc launch ubuntu-daily: focal focal1
$ lxc shell focal1
1. First of all, update the apt packages index.
$ sudo apt update
2. Install logwatch package.
$ sudo apt install logwatch
3. Perform $ sudo logwatch --detail low --range today --service all --output stdout
Follow the reproduction steps above to ensure that the proposed solution works and the message vanished away.
Expected results:
1. $ sudo apt update
2. $ sudo apt install logwatch
3. $ sudo logwatch --detail low --range today --service all --output stdout
4. Network report is generated.
Actual results:
1. $ sudo apt update
2. $ sudo apt install logwatch
3. $ sudo logwatch --detail low --range today --service all --output stdout
4.
-------
can't use /sbin/ifconfig -a: No such file or directory at /usr/share/
------
[Where problems could occur]
There is a possibility that more advanced users can figure out a solution themselves and install net-tools package which includes ifconfig and it would solve the problem, but the functionality of the script would suffer, because the ‘ip addr’ needs to be selected preferentially.
We decided to minimize behavioral change in the stable release by continuing to use ifconfig if it is available, but falling back to ip if not. Users might find this surprising because the behavior of the command will now depend on what other packages are installed, but this seems preferable to pulling in a new dependency in a stable release, or in changing existing report output for users who already have ifconfig available either by accident or by deliberately having worked around the bug.
If there were to be a regression caused by this change is likely to be around the availability of ip and/or ifconfig or a behavioral consequence of calling ip when we weren’t before.
Since logwatch is used just for generating reports, any regression would be limited in scope to the generation of use of the report.
-------
On focal, logwatch is attempting to use ifconfig rather than ip addr:
$ sudo logwatch --detail Low --range today --service all --output stdout
...
------
can't use /sbin/ifconfig -a: No such file or directory at /usr/share/
------
N.b. if you have ifconfig installed, the tool works, however looking at the zz-network script it appears to prefer use of ip, so it should work with net-tools uninstalled.
Related branches
- Bryce Harrington (community): Approve
- Utkarsh Gupta (community): Needs Fixing
- Robie Basak: Needs Fixing
- Canonical Server Reporter: Pending requested
- git-ubuntu import: Pending requested
-
Diff: 56 lines (+17/-8)3 files modifieddebian/changelog (+9/-0)
debian/patches/focal-logwatch-ifconfig-fix.patch (+7/-7)
debian/patches/series (+1/-1)
- git-ubuntu bot: Approve
- Bryce Harrington (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 56 lines (+34/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/focal-logwatch-ifconfig-fix.patch (+26/-0)
debian/patches/series (+1/-0)
description: | updated |
Changed in logwatch (Ubuntu): | |
status: | Confirmed → Triaged |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
Changed in logwatch (Ubuntu Focal): | |
assignee: | nobody → Michał Małoszewski (michal-maloszewski99) |
Changed in logwatch (Ubuntu Kinetic): | |
assignee: | Michał Małoszewski (michal-maloszewski99) → nobody |
Changed in logwatch (Ubuntu Focal): | |
status: | New → In Progress |
Changed in logwatch (Ubuntu Kinetic): | |
status: | Triaged → Fix Released |
Changed in logwatch (Ubuntu Jammy): | |
status: | New → Fix Released |
Changed in logwatch (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in logwatch (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in logwatch (Ubuntu Kinetic): | |
importance: | Medium → Undecided |
tags: |
added: verification-needed-focal removed: verification-done-focal |
tags: |
added: verification-failed verification-failed-focal removed: verification-needed verification-needed-focal |
Changed in logwatch (Ubuntu Focal): | |
status: | Confirmed → In Progress |
tags: |
added: verification-done removed: verification-needed |
Status changed to 'Confirmed' because the bug affects multiple users.