Re: [Lxc-users] lxc-wait doesn't notice container shutdown
On 08/07/2013, at 11:02 PM, Michael H. Warfield m...@wittsend.com wrote: On Mon, 2013-07-08 at 18:27 +1000, Christoph Willing wrote: On 05/07/2013, at 9:53 PM, Serge Hallyn serge.hal...@ubuntu.com wrote: Quoting Christoph Willing (cwill...@users.sourceforge.net): Since upgrading from lxc-0.7.5 to 0.9.0 I have a problem with lxc-wait. Previously, scripts containing an lxc-wait for the STOPPED state would continue as expected when the nominated container shut itself down i.e. the script received the STOPPED state and lxc-wait exits. However with 0.9.0, lxc-wait doesn't seem to receive the STOPPED state when the container shuts itself down - the scripts just keep waiting. I can run lxc-stop manually, whereupon the waiting script then sees that the container gets the message and continues as before. On the other hand, the same scripts see the RUNNING state of a newly started container and continue execution as before. So although lxc-wait is working (receives states sent explicitly via lxc-start/stop), it no longer receives any indication from the container that is is shutting down. Is this new behaviour expected in 0.9.0? No it sounds unexpected. Would you be able to code the above into a little test script to reproduce? (something like sudo lxc-create -t ubuntu -n x1 sudo lxc-start -n x1 -d sudo nohup lxc-wait -s STOPPED -n x1 /tmp/outout 21 pid=$! sudo lxc-sttach -n x1 -- poweroff tail /tmp/outout ps -p $pid echo lxc-wait still running - FAIL ps -p $pid || echo lxc-wait exited - PASS ) Also please tell us which distro+release you're on and the exact package or upstream git version (there have been very recent changes...) Is lxc-wait a script or a program in yours? (which lxc-wait; file `which lxc-wait`) I found fixed the problem but, for interest, the affected distro is Slackware current (the next release), using package lxc-0.9.0-x86_64-1 from which lxc-wait is a program: chris@current:~$ which lxc-wait; file `which lxc-wait` /usr/bin/lxc-wait /usr/bin/lxc-wait: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped Since there is no distributed lxc-slackware template, I've made my own which I install locally. I've been using the same basic template for about the last 3 Slackware releases and have had no problems. Part of the the template's execution involves patching some of Slackware's default rc.d scripts for use in the container. For some reason, the patching removes the reboot/poweroff calls in rc.6 (the shutdown script). I don't recall now why that was done - whether it was mistaken or intentional - yet everything had all worked as expected until now. Anyway, assuming it was a mistake and so changing my template to leave the reboot/poweroff calls intact has fixed the problem - lxc-wait receives the STOPPED state again. Historically, removing the calls to reboot/poweroff were done, at the very least, to circumvent the read-only remounts of mounted file systems in the host. We've been plagued by that problem on and off again for some time and never really nailed it. I think the latest fixes for dealing with systemd based systems is ultimately incompatible with some of the host workarounds (bind mounts) which some of use were using to avoid that problem as well. There may have been other reasons but that was, most emphatically, one of them. Thanks for jogging my memory Mike. I do now remember the problem of read-only remounts and it explains why I would have removed the reboot/shutdown calls. Now that I need them back in, I'd better check my containers scripts for a return of those bad behaviours - although I didn't notice any of them while troubleshooting my absence of STOPPED state problem, so fingers crossed .. chris -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
[Lxc-users] lxc-wait doesn't notice container shutdown
Since upgrading from lxc-0.7.5 to 0.9.0 I have a problem with lxc-wait. Previously, scripts containing an lxc-wait for the STOPPED state would continue as expected when the nominated container shut itself down i.e. the script received the STOPPED state and lxc-wait exits. However with 0.9.0, lxc-wait doesn't seem to receive the STOPPED state when the container shuts itself down - the scripts just keep waiting. I can run lxc-stop manually, whereupon the waiting script then sees that the container gets the message and continues as before. On the other hand, the same scripts see the RUNNING state of a newly started container and continue execution as before. So although lxc-wait is working (receives states sent explicitly via lxc-start/stop), it no longer receives any indication from the container that is is shutting down. Is this new behaviour expected in 0.9.0? chris -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] xf86OpenConsole: VT_ACTIVATE failed: Invalid argument
On 21/03/2013, at 7:44 PM, Guillaume Thouvenin guillaume.thouve...@polymtl.ca wrote: Hello everybody, I'm still trying to run an X server in a container with GLX support. I compiled the official driver provided by nvidia. Everything worked fine and I could load the kernel module. So I started X. The nvidia_drv.so was loaded correctly, I was exited but at the end of the Xorg.0.log I got: [174183.355] (II) LoadModule: nvidia [174183.356] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so [174183.356] (II) Module nvidia: vendor=NVIDIA Corporation [174183.356]compiled for 4.0.2, module version = 1.0.0 [174183.356]Module class: X.Org Video Driver [174183.356] (II) NVIDIA dlloader X Driver 304.54 Sat Sep 29 00:07:17 PDT 2012 [174183.356] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs [174183.356] (--) using VT number 2 [174183.356] (WW) xf86OpenConsole: VT_GETSTATE failed: Invalid argument [174183.356] Fatal server error: [174183.356] xf86OpenConsole: VT_ACTIVATE failed: Invalid argument I straced the problem and I found something that seems intresting to me: X is opening /dev/tty2 and does an ioctl that fails: open(/dev/tty2, O_RDWR|O_NONBLOCK) = 9 ioctl(9, VT_GETSTATE, 0x7fff94f0fc60) = -1 EINVAL (Invalid argument) I run a number of machines with dual nvidia cards - 1 running in the host and 1 running in a container. In the container, I start the X server using xinit directly with the -novtswitch and -sharevts options. Maybe something like that will help? It works well here - all the goodies are enabled: [42.781] (II) Reloading /usr/lib64/xorg/modules/extensions/libdri2.so [42.781] (II) NVIDIA(1): [DRI2] Setup complete [42.781] (II) NVIDIA(1): [DRI2] VDPAU driver: nvidia [42.781] (==) RandR enabled [42.781] (II) Initializing built-in extension Generic Event Extension [42.781] (II) Initializing built-in extension SHAPE [42.781] (II) Initializing built-in extension MIT-SHM [42.781] (II) Initializing built-in extension XInputExtension [42.781] (II) Initializing built-in extension XTEST [42.781] (II) Initializing built-in extension BIG-REQUESTS [42.781] (II) Initializing built-in extension SYNC [42.781] (II) Initializing built-in extension XKEYBOARD [42.781] (II) Initializing built-in extension XC-MISC [42.781] (II) Initializing built-in extension XINERAMA [42.781] (II) Initializing built-in extension XFIXES [42.781] (II) Initializing built-in extension RENDER [42.781] (II) Initializing built-in extension RANDR [42.781] (II) Initializing built-in extension COMPOSITE [42.781] (II) Initializing built-in extension DAMAGE [42.782] (II) Initializing extension GLX chris I'm using an ubuntu 12.04.2. I created a file /etc/inittab where I added: c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux c3:2345:respawn:/sbin/agetty -8 38400 tty3 linux c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux And I also added lxc.tty = 4 in my lxc configuration file but There is still a problem with /dev/tty2. If anyone has some hints or any links to help me he is welcome :) Note: I tested the xorg.conf outside the container (ie on the host) and it is working. Now I want to do the same but in the container so on the host I did an rmmod on the nvidia kernel module and halted the X server. The complete lxc config file is pasted at the end of the email. Regards, Guillaume lxc.network.type=veth lxc.network.link=local_br lxc.network.name=eth0 lxc.network.flags=up lxc.network.hwaddr = 52:54:BE:EF:4b:96 lxc.network.type=veth lxc.network.link=mngmtbr lxc.network.name=eth1 lxc.network.flags=up lxc.network.hwaddr = 52:54:BE:EF:4b:97 #Network is configured inside the guest otherwise #gateway is not well sets. Maybe a LXC bug... #lxc.network.ipv4=192.168.35.13/24 #lxc.network.ipv4.gateway=192.168.35.1 lxc.utsname = testvm1 lxc.devttydir = lxc lxc.tty = 4 lxc.pts = 1024 lxc.mount = /var/lib/lxc/testvm1/fstab lxc.arch = amd64 lxc.cap.drop = mac_admin lxc.pivotdir = lxc_putold # uncomment the next line to run the container unconfined: #lxc.aa_profile = unconfined lxc.cgroup.devices.deny = a # Allow any mknod (but not using the node) lxc.cgroup.devices.allow = c *:* m lxc.cgroup.devices.allow = b *:* m # /dev/mem lxc.cgroup.devices.allow = c 1:1 rwm # /dev/null and zero lxc.cgroup.devices.allow = c 1:3 rwm lxc.cgroup.devices.allow = c 1:5 rwm # consoles lxc.cgroup.devices.allow = c 5:1 rwm lxc.cgroup.devices.allow = c 5:0 rwm lxc.cgroup.devices.allow = c 4:0 rwm lxc.cgroup.devices.allow = c 4:1 rwm lxc.cgroup.devices.allow = c 4:2 rwm lxc.cgroup.devices.allow = c 4:3 rwm lxc.cgroup.devices.allow = c 4:4 rwm # /dev/{,u}random lxc.cgroup.devices.allow = c 1:9 rwm lxc.cgroup.devices.allow = c 1:8 rwm lxc.cgroup.devices.allow = c 136:* rwm
Re: [Lxc-users] PostgreSQL - sh: cannot create /dev/null: Permission denied - LXC Issue?
online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users Christoph Willing +61 7 3365 8316 Research Computing Centre University of Queensland -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] LXC and Slackware 13.37
On 13/07/2011, at 4:29 PM, Laurens Vets wrote: Hello, I'm trying to configure LXC on Slackware 13.37 following these 2 guides: http://www.vislab.uq.edu.au/howto/lxc.html http://www.vislab.uq.edu.au/howto/lxc/create_container.html. However, I cannot reach the LXC guest when I try to connect to it. In the howto I see the following line for the config-file: lxc.network.ipv4 = 0.0.0.0 Did you replace that 0.0.0.0 with the desired ip-number of the container? Yes, following is my config file: lxc.utsname = dns lxc.mount = /jails/dns/etc/fstab lxc.rootfs = /jails/dns lxc.tty = 6 lxc.network.type = veth lxc.network.flags = up lxc.network.link = br0 lxc.network.hwaddr = 00:50:56:00:07:fc # Given to me by Hetzner lxc.network.ipv4 = 188.x.x.x/26 /etc/rc.d/rc.inet1.conf is set up with this too (plus netmask gateway)? Apart from its network problem, is the container otherwise running? i.e. can you lxc-console into it? chris lxc.network.name = eth0 lxc.network.mtu= 1500 lxc.cgroup.devices.deny = a # /dev/null and zero lxc.cgroup.devices.allow = c 1:3 rwm lxc.cgroup.devices.allow = c 1:5 rwm # consoles lxc.cgroup.devices.allow = c 5:1 rwm lxc.cgroup.devices.allow = c 5:0 rwm lxc.cgroup.devices.allow = c 4:0 rwm lxc.cgroup.devices.allow = c 4:1 rwm # /dev/{,u}random lxc.cgroup.devices.allow = c 1:9 rwm lxc.cgroup.devices.allow = c 1:8 rwm # /dev/pts/* - pts namespaces are coming soon lxc.cgroup.devices.allow = c 136:* rwm lxc.cgroup.devices.allow = c 5:2 rwm # rtc lxc.cgroup.devices.allow = c 254:0 rwm That 188.x.x.x address is in the same range as the address of the host. -- AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on Lean Startup Secrets Revealed. This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users Christoph Willing +61 7 3365 8316 QCIF Access Grid Manager University of Queensland -- AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on Lean Startup Secrets Revealed. This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] GUI container
On 17/12/2010, at 9:40 AM, Nirmal Guhan wrote: On Thu, Dec 16, 2010 at 12:06 PM, Nirmal Guhan vavat...@gmail.com wrote: On Fri, Dec 10, 2010 at 2:40 PM, Christoph Willing c.will...@uq.edu.au wrote: On 11/12/2010, at 1:04 AM, Matto Fransen wrote: Hi, On Thu, Dec 09, 2010 at 10:21:49PM -0800, Nirmal Guhan wrote: Has anyone tried running a GUI app (firefox for instance) inside a container or as an application container? Just want to know if this requires any special steps before I tread that path. Am using Fedora 12 for both host and container. It is no problem to run GUI apps in a container. I have set up one of my containers as an X-server. From an old laptop I do X -query ip-number and run the window-manager that is installed on the container. You can use ssh -X to log in into the container and start your X-app. Most of my containers are without X (run level 3). When I have one that needs a X environment I start an Xvfb with a simple window manager (mwm) using a boot script. When I need gui type access to it, I run x11vnc in the container and access that environment from anywhere with vncviewer. Do I need to start container with X (level 5?). I tried these steps : 1. Start container in level 3. 2. lxc-console into container 3. Run Xvfb (that returned error as) #Xvfb :0 -screen 0 1024x768x16 -ac SELinux: Invalid object class mapping, disabling SELinux support. (EE) AIGLX error: dlopen of /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory) (EE) GLX: could not load software renderer 4. Run mwm # mwm Error: Can't open display: 0.0 I have set display to 0.0 If I start Xvfb with no options I still get the above errors. Any idea on what I am missing? Thanks, Nirmal Worked after setting the display to ipaddress:0. BTW, a naive question. Is it possible to start the container itself in level 5 as I do for host so I don't have to use vnc stuff ? I haven't tried it but it may work if you have a different physical display available - maybe even a different graphics card is needed. If you have the host and container each at run level 5 then they would each be running an X server. I don't think they could both control the same graphics card - you'd probably need 1 card for each X server. I'm just guessing though ... chris Christoph Willing +61 7 3365 8316 QCIF Access Grid Manager University of Queensland -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] list OK? Late email arrivals (was: GUI container)
The email below just arrived via Lxc-users list. I sent it last 17th December so its taken a _long_ time to reach the list. Other cc'd recipients received their copies more or less immediately as expected. I see another email with subject unable to set default gw, sent 14th December also just arrived. Is something wrong with list operation? chris On 17/12/2010, at 10:17 AM, Christoph Willing wrote: On 17/12/2010, at 6:06 AM, Nirmal Guhan wrote: On Fri, Dec 10, 2010 at 2:40 PM, Christoph Willing c.will...@uq.edu.au wrote: On 11/12/2010, at 1:04 AM, Matto Fransen wrote: Hi, On Thu, Dec 09, 2010 at 10:21:49PM -0800, Nirmal Guhan wrote: Has anyone tried running a GUI app (firefox for instance) inside a container or as an application container? Just want to know if this requires any special steps before I tread that path. Am using Fedora 12 for both host and container. It is no problem to run GUI apps in a container. I have set up one of my containers as an X-server. From an old laptop I do X -query ip-number and run the window-manager that is installed on the container. You can use ssh -X to log in into the container and start your X-app. Most of my containers are without X (run level 3). When I have one that needs a X environment I start an Xvfb with a simple window manager (mwm) using a boot script. When I need gui type access to it, I run x11vnc in the container and access that environment from anywhere with vncviewer. Do I need to start container with X (level 5?). No need for that since we're starting our own Xvfb I tried these steps : 1. Start container in level 3. 2. lxc-console into container 3. Run Xvfb (that returned error as) #Xvfb :0 -screen 0 1024x768x16 -ac SELinux: Invalid object class mapping, disabling SELinux support. (EE) AIGLX error: dlopen of /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory) (EE) GLX: could not load software renderer 4. Run mwm # mwm Error: Can't open display: 0.0 If Xvfb hasn't started (as above) then mwm can't run. - there is no display to open. I have set display to 0.0 If I start Xvfb with no options I still get the above errors. Any idea on what I am missing? I don't have SELinux to contend with; you'll have to fix that first. Here is the script I use which runs at boot time. The apps are all run as an ordinary user ag. I use display :1 out of habit (after testing on machines where there is already an existing :0) but you can choose anything reasonable. # Commands to provide display environment for AGServiceManager vic # su -c '/usr/bin/Xvfb :1 -screen 0 1024x768x24' ag su -c '/usr/bin/mwm -display :1' ag # Run the service manager as user 'ag' # su -c 'DISPLAY=:1 /usr/bin/AGServiceManager3.py -d' ag Thats enough to run what I need in that container without further input from me. If I do want to use that X environment remotely for some reason, I ssh as user ag (or lxc-console and su - ag) into the container and run: x11vnc -rfbauth /home/ag/.vnc/passwd -display :1 (assumes you've previously set up a vnc password) and then from a remote machine, run: vncviewer conatiner_ip_addr:0 chris Christoph Willing +61 7 3365 8316 QCIF Access Grid Manager University of Queensland -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] GUI container
On 11/12/2010, at 1:04 AM, Matto Fransen wrote: Hi, On Thu, Dec 09, 2010 at 10:21:49PM -0800, Nirmal Guhan wrote: Has anyone tried running a GUI app (firefox for instance) inside a container or as an application container? Just want to know if this requires any special steps before I tread that path. Am using Fedora 12 for both host and container. It is no problem to run GUI apps in a container. I have set up one of my containers as an X-server. From an old laptop I do X -query ip-number and run the window-manager that is installed on the container. You can use ssh -X to log in into the container and start your X-app. Most of my containers are without X (run level 3). When I have one that needs a X environment I start an Xvfb with a simple window manager (mwm) using a boot script. When I need gui type access to it, I run x11vnc in the container and access that environment from anywhere with vncviewer. chris Christoph Willing +61 7 3365 8316 QCIF Access Grid Manager University of Queensland -- Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
[Lxc-users] rwm field for lxc.cgroup.devices.allow
In all my container configuration files, I'm using (based on various howtos I've seen) a bunch of entries similar to: lxc.cgroup.devices.allow = c 5:1 rwm I can't find what the rwm is for - is it some sort of permission field e.g. read/write/something? Thanks, chris -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users