The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1425
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === 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. Adding `exit 1` here makes it exit non-zero to make systemd recognize the failure.
From 759935a33c69c15aafff233df7d53cc424080ec8 Mon Sep 17 00:00:00 2001 From: Carsten Brandt <m...@cebe.cc> Date: Wed, 8 Feb 2017 14:46:59 +0100 Subject: [PATCH] Make lxc-net return non-zero on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Adding `exit 1` here makes it exit non-zero to make systemd recognize the failure. --- config/init/common/lxc-net.in | 1 + 1 file changed, 1 insertion(+) diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in index 4797f20..f770950 100644 --- a/config/init/common/lxc-net.in +++ b/config/init/common/lxc-net.in @@ -66,6 +66,7 @@ start() { if [ "$FAILED" = "1" ]; then echo "Failed to setup lxc-net." >&2 stop force + exit 1 fi }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel