[lxc-devel] [lxc/lxc] 4f4e71: Make lxc-net return non-zero on failure

GitHub noreply at github.com
Wed Feb 8 16:08:41 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 4f4e7141dd98b91332ea6d78708cf7208310d8a9
      https://github.com/lxc/lxc/commit/4f4e7141dd98b91332ea6d78708cf7208310d8a9
  Author: Carsten Brandt <mail at cebe.cc>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M config/init/common/lxc-net.in

  Log Message:
  -----------
  Make lxc-net return non-zero on failure

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.

Signed-off-by: Carsten Brandt <mail at cebe.cc>


  Commit: b93fbd248601d4e54dad54b8e03092fcee205048
      https://github.com/lxc/lxc/commit/b93fbd248601d4e54dad54b8e03092fcee205048
  Author: Stéphane Graber <stgraber at stgraber.org>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M config/init/common/lxc-net.in

  Log Message:
  -----------
  Merge pull request #1425 from cebe/patch-1

Make lxc-net return non-zero on failure


Compare: https://github.com/lxc/lxc/compare/920da314e664...b93fbd248601


More information about the lxc-devel mailing list