[lxc-devel] how to tell lxc-monitord to go away?
Hi folks, If I shut down my drbd partition to mount it on another host, then lxc-monitord keeps the mount point busy for at least 30 seconds. This means additional 30 seconds unavailability of the service provided by the container. Highly painful. Do you think it would be possible to write down the PID somewhere to support kill `cat /somepath/lxc/lxc-monitord.pid` as usual? Or is there an undocumented feature in lxc-monitor, e.g. lxc-monitor -P /somepath/lxc --kill? Many thanx in advance Harri -- Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk ___ lxc-devel mailing list lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] making lxcpath a real path?
Hi folks, do you think it would be possible to make the path set by -P/--lxcpath or in the config file a _real_ path, e.g. lxc-ls -P /data1/lxc:/data2/lxc --fancy ? This could help to support HA scenarios based on DRBD or a network file system, for example. If one LXC server dies, then a fallback host could take over the abandoned /data2/lxc in parallel to its own /data1/lxc directory. Regards Harri -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] making lxcpath a real path?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Mike, Of course I understand that the lxc container search path might lead to confusion in case of ambiguous container names. However, similar problems exist for $PATH and $LD_LIBRARY_PATH and others. How about first match wins? If lxcpath is a search path, then I see no other way than to distinguish between the lxc-commands working on existing containers, and the lxc-commands requiring a destination directory (to create, move or migrate a container). Do you think it would be possible to use lxc-create -n /some/absolute/path/to/my_container or lxc-create -n ../local/path/to/my_container (ignoring the lxcpath)? Do we need commands like lxc-edit-config -n my_container to make sure that my_container is just a container identifier without revealing it as a Posix directory name? Regards Harri -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) iQEcBAEBCAAGBQJSniyXAAoJEAqeKp5m04HL+IEIAIYVojPMHJlUgTDIm2E1BW4F zO6/A1sqxq4nN5VSyUtmL1iVVulLnWCJOlnhy6Sli4aCZebT5fi7LbNMPrYuE7K1 p5py3QgzRvcka7vIVx18/DPj6XLIjUA4HiogDHfd0wgn6JXASGzB2fztJfT8B0RB JZ4gzBigQtJ9k3NuVpYE5Yh+ZLoQVaJQUCI6atJw9lDnSdcqV+ff4G0xD/ReueWV mopTQc/Ek/aAihq0mquPmndzVlWB8uPVEJUWD8SWy8fymeK6+24mS4dhggfFSBZ5 NGNoaEDxjkzD6zL8bI+/WaIyr1OBd4g8inEdn9uAY1atrClTNDbS2N8BzAOJsTQ= =WtrK -END PGP SIGNATURE- -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] what happened to the autostart proposals?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi folks, there were several proposals on this mailing list about how to start and stop a group of LXC containers, e.g. at boot or shutdown time. Are there any news about this? Regards Harri -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.15 (GNU/Linux) iQEcBAEBCAAGBQJSYX1tAAoJEAqeKp5m04HLUckH/2nFPN2Px08ZoivqeRIBzhG2 5B9YTDqt2gscukA2hFQIKsblPrrEqT4hL/iVwQU0OP95Vq+xZlxAsrbgsHM3dXp4 xm/yyrENtKLjOi9mHWFuYQSaMp2crKG9jXrR1bQ0hVfJ9Qty+IuKeq0RCJCdh179 cU/4kyT8xvk0oTWZM8HXFMHQTzQRgGq4ZcbOAuHQdd0W5WSz92yDjQVpHv72lGHs LeR914bxC4wZgcDnTVH3L0gkWzPcElNNgKAJbPVJgi/mYzu7voRb4v1aEPe75YOV 7/SArT0v7u6RXbUEdvwUo3gluJ12rGkQ2EcdrW5LpMJN9GqDqY/b2HdoBPn4YbU= =Bdx1 -END PGP SIGNATURE- -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] LXC_DIRECTORY remounted read-only
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Serge, On 09/06/13 19:04, Serge Hallyn wrote: Uh. what the... lxc_spawn closes the pinfd right before returning success. This is a bug in commit 2b0e17e48f4f55ddfcde74d1f00932837fa2cfda Thanks for reporting it! I am glad to help. Please keep on your good work Harri -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAEBCAAGBQJSK5PGAAoJEAqeKp5m04HLetQIAIrn/VsqCGxN/JfkvPMzhmQN v+vyNf86m17fcfXJwFpV77/72g5ZDCGIxNyY069gVWJ8aXKIKiR9PcokWChgpJu1 +5O0ZnZRhxLt17brvuFkKy0aJX9BhGpNyFGWMJv+wxuib+PpnTjOJ32+BNFfJ2Wy N5KwmsgcnyoEjKrtnjpPGK9rtYFCdmAWDbD7Y1X0D19U4xymx0H2aQQ7MwKZMfKn jKPd/W++Vrgimv4++m41QUSRhUonpN4avzTfMoL2ED4LPWso+AgKSE18O6vATYDl PqJjivG3u9sTFw9PXe4/VpAR9ftb/7oTn+rtxStHui1lunDFyrD+GCWwn8xj8ZA= =rKJu -END PGP SIGNATURE- -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] LXC_DIRECTORY remounted read-only
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Serge, On 08/26/13 13:41, Serge Hallyn wrote: Lxc should be creating a $lxcpath/$lxcname/rootfs.hold and keeping that open for write, which should prevent the remount -o ro. Does that file exist in your case? Which filesystem is mounted on /export/lxc? Filesystem is ext4. It seems that this problem comes up, if I run halt within the container. Using lxc-stop on the server I couldn't reproduce it by now. Sample session: {root@cecil:~ 501} lxc-create -t debian -n no2 debootstrap is /usr/sbin/debootstrap Checking cache download in /var/cache/lxc/debian/rootfs-squeeze-amd64 ... Copying rootfs to /usr/lib/x86_64-linux-gnu/lxc...Generating locales (this might take a while)... Generation complete. update-rc.d: using dependency based boot sequencing update-rc.d: using dependency based boot sequencing update-rc.d: using dependency based boot sequencing update-rc.d: using dependency based boot sequencing Root password is 'root', please change ! {root@cecil:~ 501} mount | grep /export /dev/md0p4 on /export type ext4 (rw,noatime,stripe=32,data=ordered) {root@cecil:~ 501} lxc-start -n no2 INIT: version 2.88 booting Using makefile-style concurrent boot in runlevel S. : : Debian GNU/Linux 6.0 no2 console no2 login: root Password: Linux no2 3.10.10 #1 SMP PREEMPT Fri Aug 30 06:47:21 CEST 2013 x86_64 root@no2:~# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully root@no2:~# halt Broadcast message from root@no2 (console) (Sat Aug 31 06:19:47 2013): The system is going down for system halt NOW! INIT: Switching to runlevel: 0 INIT: Sending processes the TERM signal Using makefile-style concurrent boot in runlevel 0. Asking all remaining processes to terminate...done. All processes ended within 2 secondsdone. Deconfiguring network interfaces...ifdown: failed to open statefile /etc/network/run/ifstate: Read-only file system failed. Cleaning up ifupdown...rm: cannot remove `/etc/network/run/ifstate': Read-only file system Will now halt. {root@cecil:~ 501} mount | grep /export /dev/md0p4 on /export type ext4 (ro,noatime,stripe=32,data=ordered) {root@cecil:~ 501} ls -al /export/lxc/no2 total 16 drwxr-xr-x 3 root root 4096 Aug 31 08:19 . drwxr-xr-x 8 root root 4096 Aug 31 08:18 .. - -rw-r--r-- 1 root root 1001 Aug 31 08:18 config drwxr-xr-x 20 root root 4096 Aug 31 08:19 rootfs - -rw--- 1 root root0 Aug 31 08:19 rootfs.hold AFAICS the file system is remounted read-only, while the container is still active. Hope this helps. Harri -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAEBCAAGBQJSIY07AAoJEAqeKp5m04HLOZkH/AqZGf4mUHB/GbLfg7zDYfRK XeJbFbBQOFzA+/YiEtrBJlD/Uh6M2QS44C8QiKfT76PHcf3GZku8EyybUaR1hqRM Qho5ADmW/TIEMP/unV6kI9WZ7srE6kj7OSWUEVVpwdH0TQpvcnYwNR0bmhL7H4O6 cmDcuJc5dJGDPTcbejcW4/tt22P4TWkn+6rOfAHfgQQtUWCJlZy2g+IxG0A0E/Ix yhRotBK/OR1m+wlVfNtDgcO2TdiavS+NSOAuxqiUjOuKg7chs3TQjtJ5/2rWWAVt cL8hDZ6cruLgEqPtXJn4Z0wfA6nATy9MncNEcB977KG9wjr4XsdAaC9BldueM28= =2iPO -END PGP SIGNATURE- -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] LXC_DIRECTORY remounted read-only
Hi folks, seems that on the exit of the last container the partition providing the ${LXC_DIRECTORY} is remounted read-only, ignoring /etc/fstab or other users working on /export. (/var/lib/lxc is a symlink pointing to /export/lxc.) It would be very nice to have a config option in /etc/default/lxc to turn this off. lxc is version cb0c6c020314ee0fea0ce30d209711f7e9c29aaa on the staging branch. Many thanx Harri -- Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] lxc-start: Failed to find current cgroup
Hi folks, On 08/19/13 00:57, Christian Seiler wrote: Hi there, FYI: I had the same problem with current staging and the first patch I sent in my latest series fixes this: http://thread.gmane.org/gmane.linux.kernel.containers.lxc.devel/3977 -- Christian The current version fb760f70541c9af728eb2ab0c6175875f7448752 doesn't show this problem anymore. Many thanx to all Harri -- Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] lxc-start: Failed to find current cgroup
Hi folks, Using the current (d24d56d7ee3420bb79238ff84cad07c20cf4757d) version lxc-start gives me # lxc-start -n lxc0 lxc-start: Failed to find current cgroup lxc-start: Out of memory reading cgroups lxc-start: failed to spawn 'lxc0' The same container worked before for the lxc version checked out on 130811. Unfortunately I don't have the ID for git. ??? Every helpful hint is highly appreciated. Harri -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] lxc-start: Failed to find current cgroup
Hi Serge, On 08/17/13 15:29, Serge Hallyn wrote: Quoting Harald Dunkel (ha...@afaics.de): Hi folks, Using the current (d24d56d7ee3420bb79238ff84cad07c20cf4757d) version lxc-start gives me # lxc-start -n lxc0 lxc-start: Failed to find current cgroup lxc-start: Out of memory reading cgroups lxc-start: failed to spawn 'lxc0' The same container worked before for the lxc version checked out on 130811. Unfortunately I don't have the ID for git. ??? Every helpful hint is highly appreciated. Sounds like my fault then. Can you please show: grep cgroup /proc/self/mountinfo cat /proc/self/cgroup cat /proc/cgroups and then do lxc-start -n lxc0 -l info -o debug.out and attach debug.out? {root@cecil:result 385} lxc-start -n lxc0 lxc-start: Failed to find current cgroup lxc-start: Out of memory reading cgroups lxc-start: failed to spawn 'lxc0' {root@cecil:result 385} grep cgroup /proc/self/mountinfo 25 19 0:18 / /cgroup rw,relatime - cgroup cgroup rw,perf_event,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,cpuset,clone_children {root@cecil:result 386} cat /proc/self/cgroup 1:perf_event,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,cpuset:/ {root@cecil:result 387} cat /proc/cgroups #subsys_namehierarchy num_cgroups enabled cpuset 1 2 1 cpu 1 2 1 cpuacct 1 2 1 memory 1 2 1 devices 1 2 1 freezer 1 2 1 net_cls 1 2 1 blkio 1 2 1 perf_event 1 2 1 {root@cecil:result 388} lxc-start -n lxc0 -l info -o debug.out lxc-start: Failed to find current cgroup lxc-start: Out of memory reading cgroups lxc-start: failed to spawn 'lxc0' See attachment 2bcontinued Harri lxc-start 1376750272.667 INFO lxc_start_ui - using rcfile /var/lib/lxc/lxc0/config lxc-start 1376750272.668 INFO lxc_apparmor - aa_enabled set to 0 lxc-start 1376750272.668 INFO lxc_conf - tty's configured lxc-start 1376750272.668 INFO lxc_start - 'lxc0' is initialized lxc-start 1376750272.681 INFO lxc_conf - opened /export/storage/lxc/lxc0/rootfs.hold as fd 20 lxc-start 1376750272.682 ERRORlxc_cgroup - Failed to find current cgroup lxc-start 1376750272.682 ERRORlxc_cgroup - Out of memory reading cgroups lxc-start 1376750272.707 ERRORlxc_start - failed to spawn 'lxc0' -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] lxc-start: Failed to find current cgroup
Hi Serge, On 08/17/13 15:29, Serge Hallyn wrote: Actually I suspect I know what happened. find_real_cgroup() doesn't look like how I remember doing it. Could you try the below (untested) patch? It'll enter you in a per-container subdir in the name=systemd cgroup, which we didn't use to do. But it may be what we want to do in the future case of unprivileged starts anyway. [PATCH 1/1] find_free_cgroup: don't ignore cgroup mounts without subsystems If we are storing it, then store our current cgroup. We might want to ignore it, but failing was the wrong thing to do in any case. Signed-off-by: Serge Hallyn serge.hal...@ubuntu.com --- src/lxc/cgroup.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index d2737ea..8caba59 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -755,13 +755,6 @@ static bool find_real_cgroup(struct cgroup_desc *d, char *path) return false; } - // If there is no subsystem, ignore the mount. Note we may want - // to change this, so that unprivileged users can use a unbound - // cgroup mount to arrange their container tasks. - if (!d-subsystems) { - fclose(f); - return false; - } while (getline(line, len, f) != -1) { if (!(p = index(line, ':'))) continue; Sorry to say, but the patch did not help. Attached is the new debug.out. Regards Harri lxc-start 1376750769.487 INFO lxc_start_ui - using rcfile /var/lib/lxc/lxc0/config lxc-start 1376750769.488 INFO lxc_apparmor - aa_enabled set to 0 lxc-start 1376750769.488 INFO lxc_conf - tty's configured lxc-start 1376750769.488 INFO lxc_start - 'lxc0' is initialized lxc-start 1376750769.509 INFO lxc_conf - opened /export/storage/lxc/lxc0/rootfs.hold as fd 20 lxc-start 1376750769.510 ERRORlxc_cgroup - Failed to find current cgroup lxc-start 1376750769.510 ERRORlxc_cgroup - Out of memory reading cgroups lxc-start 1376750769.539 ERRORlxc_start - failed to spawn 'lxc0' -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] Container autostart proposal V2
Hi Stéphane, On 05/30/13 17:39, Stéphane Graber wrote: If we were to use groups for everything, we'd end up having to reserve disabled, autostart, last-state. And then make those 3 conflict so that a container couldn't be in more than one of those at any given time. This seems rather complicated and non-obvious for our users, so I'd rather keep things simple and have separate lxc.start.auto and lxc.start.disabled config entries. Using attributes instead of group names is fine with me. lxc-stop sends SIGKILL by default which is usually instantaneous, if it's not, that's because of I/O wait on the kernel side which parallelization will just make worse. I thought this default has been changed recently, didn't it? According to the current man page lxc-stop sends SIGPWR to the container, telling init to enter run level 0, to wait for the childs, and then to exit. I'm not planning on doing anything more clever than simply doing serial start of the containers, waiting for lxc.start.delay if it's present. Using a serial startup procedure for the containers is fine with me. My major concern was about lxc-stop. Surely parallel execution would introduce much more complexity, and most of the users wouldn't notice the difference. I completely agree that things should be kept simple. Many thanx Harri -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] Container autostart proposal V2
Hi folks, If its not too late for a suggestion: lxc-stop could provide an option -A to shutdown/stop all containers, independent from their autostart flag. Worst case scenario (almost) is that a disk has an IO error and the config files cannot be read anymore. For my own part, if I want to stop the LXC server, then I don't care whether the containers were started manually or automatically. They have to stop asap to allow to unmount the partitions. And one question: Do lxc-start -a ... and lxc-stop -a ... start/stop all LXC containers in parallel, if their order and group are the same? I am concerned about accumulating timeouts or delays at shutdown or startup time of the host. Many thanx Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] Container autostart proposal V2
Hi Stéphane, On 05/30/13 15:33, Stéphane Graber wrote: That's already covered by my proposal and I believe covered in the use cases listed within it. lxc-stop -g any That'll stop all containers that are in the any group. any is documented as being a special group that contains all containers even if they have lxc.group set. My appologies, I have missed that. If LXC relies upon a special group to stop containers, wouldn't it be more consistent to use an autostart group, too? And one question: Do lxc-start -a ... and lxc-stop -a ... start/stop all LXC containers in parallel, if their order and group are the same? I am concerned about accumulating timeouts or delays at shutdown or startup time of the host. The usual STOPPED = RUNNING or RUNNING = STOPPED time is 1s, so no, we'll be doing that in serial order, but you won't really notice it because of how quick it's. Sorry, but I disagree in this case. Surely the containers start init very fast, but on shutdown time lxc-stop has to wait for _all_ processes running in the container. Some Java webapps might take an awful lot of time to stop (just as an example, meaning no offense to the Java folks). The LXC server might have 16 cores or more. Its more efficient if the containers are triggered to shut down in parallel, instead of shutting down one after the other, while the rest is still using up their own CPU time and keep the disks busy. If we assume a LXC server running 30 containers in parallel, and if every container needs 10 seconds to stop (this is not uncommon), then this means 5 minutes downtime just to stop all services. That's assuming lxc.start.delay isn't set. If it's set, then obviously startup will take longer because we'll wait of lxc.start.delay before starting the next container (parallelizing would make the whole priority/delay idea completely pointless obviously). Thats not obvious at all. The containers might have different order numbers. Only the containers with the same order number should be started (or stopped) in parallel. Lxc could wait for the largest start delay, before starting the next set of containers with the next order number. Regards Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] suggestion for an autostart flag
Hi folks, AFAICS I have to list all containers to be started at boot time in /etc/lxc/auto using symlinks pointing to the config files. Problem: /etc is a local file system. For a HA solution you usually have some kind of network device/filesystem providing the resources to manage, e.g. a DRBD or iSCSI partition holding a set of LXC config files and rootfs directories. In case of a hardware failure you change the run level on a hot standby host, some init script mounts the LXC partition, and LXC's init script is supposed to start the containers for this run level. Unfortunately the symlinks in /etc/lxc/auto have been lost together with the old host. Hopefully you see the problem. Instead of symlinks in /etc/lxc/auto I would suggest to set the config files to executable as an autostart flag. Thats very easy to set, test and clear, _and_ it is part of the filesystem providing the LXC config file. Just a suggestion, of course. Regards Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] suggestion for an autostart flag
On 05/29/13 19:30, Serge Hallyn wrote: Please see the long threads from yesterday, subject Container autostart proposal and Container autostart proposal V2 Sorry, I should have checked first. Thanx for the pointer. Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] suggestion for an autostart flag
Hi Mike, On 05/29/13 19:40, Michael H. Warfield wrote: I would strongly disagree with this proposal for several reasons. I completely agree to your concerns, esp. wrt. to overloading the executable bit and unexpected side effects. Thanx for your comment Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown
Hi Serge, On 05/03/13 17:47, Serge Hallyn wrote: Quoting Harald Dunkel (harald.dun...@aixigo.de): Or do you prefer to get the patches with the Signed-off-by added? For the sake of formality and peace of mind, please just reply to this email with something like For the series, Signed-off-by: you For the series, Signed-off-by: Harald Dunkel harald.dun...@aixigo.de Hope this helps. Regards Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] [PATCH 4/4] support alternate container path in lxc-netstat.in
--- src/lxc/lxc-netstat.in | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in index 2fa2d23..d3eee1c 100644 --- a/src/lxc/lxc-netstat.in +++ b/src/lxc/lxc-netstat.in @@ -17,8 +17,10 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +. @DATADIR@/lxc/lxc.functions + usage() { -echo usage: $(basename $0) -n|--name name -- [netstat_options] 2 +echo usage: $(basename $0) -n|--name name [-P|--lxcpath lxc_path] -- [netstat_options] 2 } help() { @@ -26,8 +28,9 @@ help() { echo 2 echo Execute 'netstat' for the specified container. 2 echo 2 -echo --name NAME specify the container name 2 -echo NETSTAT_OPTIONS netstat command options (see \`netstat --help') 2 +echo --name NAME specify the container name 2 +echo --lxcpath LXC_PATHuse an alternate container path 2 +echo NETSTAT_OPTIONS netstat command options (see \`netstat --help') 2 } get_parent_cgroup() @@ -73,6 +76,8 @@ while true; do help; exit 1;; -n|--name) name=$2; shift 2;; + -P|--lxcpath) +lxc_path=$2; shift 2;; --exec) exec=exec; shift;; --) @@ -92,11 +97,17 @@ if [ -z $name ]; then exit 1 fi +if [ -z $lxc_path ]; then +echo $(basename $0): no configuration path defined 2 +usage +exit 1 +fi + if [ -z $exec ]; then -exec @BINDIR@/lxc-unshare -s MOUNT -- $0 -n $name --exec $@ +exec @BINDIR@/lxc-unshare -s MOUNT -- $0 -n $name -P $lxc_path --exec $@ fi -if lxc-info -n $name --state-is 'STOPPED'; then +if lxc-info -n $name -P $lxc_path --state-is 'STOPPED'; then echo $(basename $0): container '$name' is not running 2 exit 1 fi -- 1.8.1.3 -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] [PATCH 2/4] lxc-create: add missing -P option for running lxc-destroy
--- src/lxc/lxc-create.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index ebbdd7b..970d3ff 100644 --- a/src/lxc/lxc-create.in +++ b/src/lxc/lxc-create.in @@ -269,7 +269,7 @@ cleanup() { btrfs subvolume delete $rootfs fi -${bindir}/lxc-destroy -n $lxc_name +${bindir}/lxc-destroy -n $lxc_name -P $lxc_path echo $(basename $0): aborted 2 exit 1 } -- 1.8.1.3 -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] [PATCH 3/4] support alternate container path in lxc-clone.in
--- src/lxc/lxc-clone.in | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lxc/lxc-clone.in b/src/lxc/lxc-clone.in index 4c8acb4..8ff9947 100755 --- a/src/lxc/lxc-clone.in +++ b/src/lxc/lxc-clone.in @@ -25,7 +25,7 @@ set -e usage() { echo usage: $(basename $0) -o ORIG_NAME -n NEW_NAME [-s] [-h] [-L FS_SIZE] 2 -echo [-v VG_NAME] [-p LV_PREFIX] [-t FS_TYPE] 2 +echo [-P LXC_PATH] [-v VG_NAME] [-p LV_PREFIX] [-t FS_TYPE] 2 } help() { @@ -38,6 +38,7 @@ help() { echo -n NEW_NAMEspecify the name of the new container 2 echo -s make the new rootfs a snapshot of the original 2 echo -L FS_SIZE specify the new filesystem size (default: same as original) 2 +echo -P LXC_PATHuse an alternate container path (default: @LXCPATH@) 2 echo -v VG_NAME specify the new LVM volume group name (default: lxc) 2 echo -p LV_PREFIX add a prefix to new LVM logical volume names 2 echo -t FS_TYPE specify the new filesystem type (default: ext3; 2 @@ -83,6 +84,11 @@ while [ $# -gt 0 ]; do lxc_size=$1 shift ;; +-P|--lxcpath) +optarg_check $opt $1 +lxc_path=$1 +shift +;; -t|--fstype) optarg_check $opt $1 fstype=$1 @@ -167,9 +173,9 @@ cleanup() { fi lvremove -f $rootdev || true fi -${bindir}/lxc-destroy -n $lxc_new || true +${bindir}/lxc-destroy -n $lxc_new -P $lxc_path || true if [ $frozen -eq 1 ]; then -lxc-unfreeze -n $lxc_orig +lxc-unfreeze -n $lxc_orig -P $lxc_path fi echo $(basename $0): aborted 2 exit 1 @@ -196,7 +202,7 @@ oldroot=`grep lxc.rootfs $lxc_path/$lxc_orig/config | awk -F'[= \t]+' '{ print $ rootfs=`echo $oldroot |sed s/$lxc_orig/$lxc_new/` container_running=True -lxc-info -n $lxc_orig --state-is RUNNING || container_running=False +lxc-info -n $lxc_orig -P $lxc_path --state-is RUNNING || container_running=False sed -i '/lxc.rootfs/d' $lxc_path/$lxc_new/config if [ -b $oldroot ]; then @@ -205,7 +211,7 @@ if [ -b $oldroot ]; then lvm=TRUE # ok, create a snapshot of the lvm device if [ $container_running = True ]; then -lxc-freeze -n $lxc_orig +lxc-freeze -n $lxc_orig -P $lxc_path frozen=1 fi if [ $lxc_size = _unset ]; then @@ -219,7 +225,7 @@ if [ -b $oldroot ]; then } if [ $container_running = True ]; then -lxc-unfreeze -n $lxc_orig +lxc-unfreeze -n $lxc_orig -P $lxc_path frozen=0 fi if [ $snapshot = no ]; then @@ -274,14 +280,14 @@ else cleanup fi if [ $container_running = True ]; then -lxc-freeze -n $lxc_orig +lxc-freeze -n $lxc_orig -P $lxc_path frozen=1 fi mkdir -p $rootfs/ rsync -Hax $oldroot/ $rootfs/ echo lxc.rootfs = $rootfs $lxc_path/$lxc_new/config if [ $container_running = True ]; then -lxc-unfreeze -n $lxc_orig +lxc-unfreeze -n $lxc_orig -P $lxc_path frozen=0 fi fi -- 1.8.1.3 -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown
--- src/lxc/lxc-shutdown.in | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in index ee07f75..247e90b 100644 --- a/src/lxc/lxc-shutdown.in +++ b/src/lxc/lxc-shutdown.in @@ -18,13 +18,17 @@ set -e +lxcpath=/var/lib/lxc +test ! -f /etc/lxc/lxc.conf || . /etc/lxc/lxc.conf + usage() { -echo usage: lxc-shutdown -n name [-w] [-r] +echo usage: lxc-shutdown -n name [-w] [-r] [-P lxcpath] echo Cleanly shut down a container. echo -w: wait for shutdown to complete. echo -r: reboot (ignore -w). echo -t timeout: wait at most timeout seconds (implies -w), then kill echo the container. +echo -P lxcpath: path to the lxc container directories. } alarm() { @@ -38,7 +42,7 @@ alarm() { dolxcstop() { echo Calling lxc-stop on $lxc_name -lxc-stop -n $lxc_name +lxc-stop -n $lxc_name -P $lxcpath exit 0 } @@ -82,6 +86,12 @@ while [ $# -gt 0 ]; do dowait=1 shift ;; +-P|--lxcpath) +optarg_check $opt $1 +lxcpath=$1 +dowait=1 +shift +;; --) break;; -?) @@ -104,6 +114,11 @@ if [ -z $lxc_name ]; then exit 1 fi +if [ ! -d $lxcpath ]; then +echo $lxcpath: no such directory +exit 1 +fi + if [ $(id -u) != 0 ]; then echo This command has to be run as root exit 1 @@ -112,7 +127,7 @@ fi which lxc-info /dev/null 21 || { echo lxc-info not found.; exit 1; } which lxc-wait /dev/null 21 || { echo lxc-wait not found.; exit 1; } -pid=`lxc-info -n $lxc_name -p 2/dev/null | awk '{ print $2 }'` +pid=`lxc-info -n $lxc_name -P $lxcpath -p 2/dev/null | awk '{ print $2 }'` if [ $pid = -1 ]; then echo $lxc_name is not running exit 1 @@ -135,7 +150,7 @@ if [ $timeout != -1 ]; then alarmpid=$! fi -while ! lxc-info -n $lxc_name --state-is STOPPED; do +while ! lxc-info -n $lxc_name -P $lxcpath --state-is STOPPED; do sleep 1 done -- 1.8.1.3 -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] [PATCH 1/4] support alternate container path in lxc-shutdown
Hi Serge, On 05/03/13 14:16, Serge Hallyn wrote: Quoting Harald Dunkel (harald.dun...@aixigo.de): --- src/lxc/lxc-shutdown.in | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-shutdown.in b/src/lxc/lxc-shutdown.in index ee07f75..247e90b 100644 --- a/src/lxc/lxc-shutdown.in +++ b/src/lxc/lxc-shutdown.in @@ -18,13 +18,17 @@ set -e +lxcpath=/var/lib/lxc +test ! -f /etc/lxc/lxc.conf || . /etc/lxc/lxc.conf Other scripts do this using: . @DATADIR@/lxc/lxc.functions Sorry, I have missed that for lxc-shutdown. Otherwise looks good, thanks. (Please let me know if you'd like to resend or have me change it in-line) Probably its the most easiest way to change it in-line. Or do you prefer to get the patches with the Signed-off-by added? Regards Harri -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
Re: [lxc-devel] patches to implement -P for the lxc-* scripts
On 05/03/13 14:26, Serge Hallyn wrote: Hm, are you looking at https://github.com/lxc/lxc/tree/staging/src/lxc ? ??? http://lxc.sourceforge.net/index.php/about/lxc-development/ says to use git://lxc.git.sourceforge.net/gitroot/lxc/lxc. There was no staging repository mentioned. Regards Harri -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel
[lxc-devel] patches to implement -P for the lxc-* scripts
Hi folks, I would like to contribute patches for lxc-shutdown lxc-clone lxc-create lxc-netstat to support an alternate container directory using -P|--lxcpath, similar to the binary executables. Is somebody interested for review first? It would be nice to get a sponsor for this. Regards Harri -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with 2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 ___ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel