[pkg-lxc-devel] Bug#854591: lxc-net service exits zero on failure
Carsten Brandt
debian at cebe.cc
Wed Feb 8 13:48:00 UTC 2017
Package: lxc
Version: 1:2.0.6-1~bpo8+1
Severity: normal
Tags: patch
Dear Maintainer,
I found that even though the service lxc-net failed to start because I made some wrong configuration
settings the command exists zero.
So systemd reports the status of the service as good even though it failed:
# service lxc-net status
● lxc-net.service - LXC network bridge setup
Loaded: loaded (/lib/systemd/system/lxc-net.service; enabled)
Active: active (exited) since Wed 2017-02-08 08:17:32 EST; 21min ago
Process: 529 ExecStart=/usr/lib/x86_64-linux-gnu/lxc/lxc-net start (code=exited, status=0/SUCCESS)
Main PID: 529 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/lxc-net.service
Feb 08 08:17:30 dvm2 systemd[1]: Starting LXC network bridge setup...
Feb 08 08:17:32 dvm2 lxc-net[529]: dnsmasq: failed to create listening socket for 10.2.2.1: Address already in use
Feb 08 08:17:32 dvm2 lxc-net[529]: Failed to setup lxc-net.
Feb 08 08:17:32 dvm2 systemd[1]: Started LXC network bridge setup.
I check the script for the service and I think the problem is in line 68 in the cleanup() function:
http://sources.debian.net/src/lxc/1:2.0.7-1/config/init/common/lxc-net.in/?hl=56#L68
after that line, a call to "exit 1" is missing to make it exit non-zero on failure.
I have sent a patch to the upstream repo: https://github.com/lxc/lxc/pull/1425
Let me know if you need further information to fix this.
best regards,
Carsten Brandt
-- System Information:
Debian Release: 8.6
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages lxc depends on:
ii init-system-helpers 1.22
ii libapparmor1 2.10.95-4~bpo8+2
ii libc6 2.19-18+deb8u7
ii libcap2 1:2.24-8
ii liblxc1 1:2.0.6-1~bpo8+1
ii libseccomp2 2.2.3-3~bpo8+1
ii libselinux1 2.3-2
ii lsb-base 4.1+Debian13+nmu1
ii python3-lxc 1:2.0.6-1~bpo8+1
pn python3:any <none>
Versions of packages lxc recommends:
ii bridge-utils 1.5-9
ii debootstrap 1.0.86~bpo8+1
ii dirmngr 1.1.1-5
ii dnsmasq-base 2.72-3+deb8u1
ii gnupg 1.4.18-7+deb8u3
ii iptables 1.4.21-2+b1
ii libpam-cgfs 2.0.5-1~bpo8+1
ii lxcfs 2.0.5-1~bpo8+1
ii openssl 1.0.1t-1+deb8u5
ii rsync 3.1.1-3
ii uidmap 1:4.2-3+deb8u1
Versions of packages lxc suggests:
pn apparmor <none>
pn btrfs-tools <none>
pn lvm2 <none>
-- no debconf information
More information about the Pkg-lxc-devel
mailing list