Hello lxc users!

I'm working on an app deployment platform that uses Supervisor 
(http://supervisord.org/) to start/stop processes.  I'd like to have apps run 
in lxc containers to limit their filesystem access (and in the future, other 
resource consumption).  I've got a script to start an app in an lxc, and it 
works from a bash prompt , but when I run the same script from Supervisor I get 
this:

lxc-execute: failed to mount the console
lxc-execute: failed to setup the console for 'testlxc'
lxc-execute: failed to setup the container

(I get the same error whether using lxc-execute or lxc-start.)

Is it expected that some things that work from a console will fail when run 
non-interactively?

Here's a sample lxc config that exhibits the problem:

root@lucid64:/tmp# cat test.lxc
lxc.utsname = testlxc
lxc.mount.entry = /bin /tmp/testlxc/bin none bind 0 0
lxc.mount.entry = /dev /tmp/testlxc/dev none bind 0 0
lxc.mount.entry = /etc /tmp/testlxc/etc none bind 0 0
lxc.mount.entry = /lib /tmp/testlxc/lib none bind 0 0
lxc.mount.entry = /lib64 /tmp/testlxc/lib64 none bind 0 0
lxc.mount.entry = /opt /tmp/testlxc/opt none bind 0 0
lxc.mount.entry = /usr /tmp/testlxc/usr none bind 0 0
lxc.rootfs = /tmp/testlxc

This script works on the command line but fails in Supervisor:

root@lucid64:/tmp# cat start_ping.sh
#!/bin/bash
lxc-execute --name testlxc -f /tmp/test.lxc -- ping google.com

And in case it becomes relevant, here's the Supervisor "program" section that 
configures running the script:

[program:testlxc]
command=/tmp/start_ping.sh
autostart=true
autorestart=true
stdout_logfile=/tmp/ping.log
user=root
directory=/tmp/testlxc
redirect_stderr=true

Thank you for your help,
Brent



---------

Brent Tubbs



[cid:image88c9fa.png@d1801d38.13c9450e]

285 Hamilton Avenue
Suite #200

Palo Alto, CA 94301

brent.tu...@yougov.com<mailto:brent.tu...@yougov.com>

http://www.yougov.com/




<<inline: image88c9fa.png@d1801d38.13c9450e>>

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to