lxc-attach command does not return error exit code if the command is failed

Bug #1861880 reported by EOLE team
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Debian)
Fix Released
Unknown
lxc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

lxc-attach command does not return error exit code if the command is failed on Ubuntu Focal :

root@scribe:~# lxc-start --version
3.0.4
root@scribe:~# lxc-attach --logpriority=DEBUG --name=addc -- exit
lxc-attach: addc: attach.c: lxc_attach_run_command: 1489 No such file or directory - Failed to exec "exit"
root@scribe:~# echo $?
0

The problem is fixed upstream : https://github.com/lxc/lxc/issues/3104 and by Debian : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934983

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: lxc-utils 3.0.4-0ubuntu2
ProcVersionSignature: Ubuntu 5.4.0-12.15-generic 5.4.8
Uname: Linux 5.4.0-12-generic x86_64
ApportVersion: 2.20.11-0ubuntu16
Architecture: amd64
Date: Tue Feb 4 16:01:30 2020
InstallationDate: Installed on 2020-01-10 (25 days ago)
InstallationMedia: Ubuntu-Server 20.04 LTS "Focal Fossa" - Alpha amd64 (20200105)
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
 lxc.net.0.type = veth
 lxc.net.0.link = lxcbr0
 lxc.net.0.flags = up
 lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc-net.default:
 USE_LXC_BRIDGE="true"
 LXC_BRIDGE="br0"
 LXC_ADDR="192.0.2.1"
 LXC_NETMASK="255.255.255.0"
 LXC_NETWORK="192.0.2.0/24"

Revision history for this message
EOLE team (eole-team) wrote :
Changed in lxc (Debian):
status: Unknown → Fix Released
Changed in lxc (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 1:4.0.0-0ubuntu2

---------------
lxc (1:4.0.0-0ubuntu2) focal; urgency=medium

  * Cherry-pick upstream bugfixes:
    - 0036-fix-non-root-user-cannot-write-dev-stdout.patch
    - 0037-cgroups-fix-uninitialized-transient_len-warning.patch
    - 0038-utils-rework-fix_stdio_permissions.patch
    - 0039-utils-use-setres-u-g-id-in-lxc_switch_uid_gid.patch
    - 0040-cgroups-fix-build-warning-on-GCC-7.patch
    - 0041-lxccontainer-poll-takes-millisecond-not-seconds.patch

 -- Stéphane Graber <email address hidden> Thu, 02 Apr 2020 12:25:20 -0400

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
EOLE team (eole-team) wrote :

OK for us with 1:4.0.1-0ubuntu2 package on focal :

root@scribe:~# lxc-start --version
4.0.1
root@scribe:~# lxc-attach --logpriority=DEBUG --name=addc -- exit
lxc-attach: addc: attach.c: lxc_attach_run_command: 1452 No such file or directory - Failed to exec "exit"
root@scribe:~# echo $?
127

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.