running-in-container exits 1 as non-root even inside a container

Bug #942961 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

$ sudo running-in-container
lxc

$ running-in-container; echo $?
1

it should at very least exit with something other than '1' this canont be determined other than as root.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: upstart 1.4-0ubuntu8
ProcVersionSignature: User Name 3.2.0-17.27-virtual 3.2.6
Uname: Linux 3.2.0-17-virtual x86_64
ApportVersion: 1.93-0ubuntu2
Architecture: amd64
Date: Tue Feb 28 23:17:20 2012
Ec2AMI: ami-00000000
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: upstart
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.init.container.detect.conf: 2012-02-28T23:12:41.439110

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for submitting this bug.

I'm not sure what we should do about this.

1. we could install dbus in all containers. dbus is required in order for non-root tasks to talk to upstart.

2. we could have running-in-container (maybe only if non-root) only check /run/container_type. /run is never persistent, so that should actually be safe.

or we could do nothing, and say it's workign as designed.

I'm tempted to say let's do (2), but I have a feeling we'll keep running into other problems if we don't do (1).

Changed in upstart (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

However running-in-container should definately print an error msg and/or have a different exit code if we let it fail due to being non-root.

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.