iptables-persistent fails in containers due to modprobe being unavailable even though module could've been loaded outside of the container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iptables-persistent (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Thomas Ward | ||
Cosmic |
Fix Released
|
Medium
|
Thomas Ward |
Bug Description
[Impact]
The `iptables-
[Test Case]
(Salvaged from bug comments, works with LXD containers)
lxc launch ubuntu:18.04 x
lxc exec x apt update
lxc exec x apt install iptables-persistent
lxc exec x netfilter-
[Regression Potential]
The regression potential from the proposed changes is extremely small and limited. The changes here were implemented in the version of `iptables-
[Other Information]
This package is a Native format package, therefore changes were made in the debdiff directly to the package, as it is not Quilt-patchable. The changes applied in the debdiffs were adjusted based on the version in Disco, which appends ` || true` to the modprobe line, so even if modprobe fails the script doesn't error out.
[Original Description]
/usr/share/
set -e
/sbin/modprobe -q iptable_filter
modprobe failure causes entire script to exit with 1 status immediately.
Processes run inside of containers (such as LXC and LXD) can't really load modules, and kernel modules usually aren't even installed anyway:
root@t1:~# /sbin/modprobe iptable_filter
modprobe: ERROR: ../libkmod/
modprobe: FATAL: Module iptable_filter not found in directory /lib/modules/
However, iptables will generally work inside containers, provided that the required modules were loaded outside the container.
So instead of failing, I think modprobe errors should be just ignored (|| true).
This seems to be the same bug as #1002078, which apparently got reintroduced during code rewrite.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: netfilter-
ProcVersionSign
Uname: Linux 4.15.0-46-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
Date: Fri Mar 15 00:06:17 2019
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: iptables-persistent
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in iptables-persistent (Ubuntu): | |
importance: | Undecided → High |
Changed in iptables-persistent (Ubuntu Bionic): | |
importance: | Undecided → High |
Changed in iptables-persistent (Ubuntu Cosmic): | |
importance: | Undecided → High |
Changed in iptables-persistent (Ubuntu): | |
importance: | High → Medium |
Changed in iptables-persistent (Ubuntu Bionic): | |
importance: | High → Medium |
Changed in iptables-persistent (Ubuntu Cosmic): | |
importance: | High → Medium |
tags: |
added: verification-done-bionic removed: verification-needed-bionic |
Quick reproduction in LXD:
lxc launch ubuntu:18.04 x persistent save
lxc exec x apt update
lxc exec x apt install iptables-persistent
lxc exec x netfilter-