[lxc-devel] [PATCH] Mounting of filesystems from fstab file

2011-01-16 Thread Joerg Gollnick
Dear all,
while setting up a container on x86_64 (archlinux host/guest) I had trouble 
with mounting dev/pts and others from container.fstab and a ssh login does not 
work (only ssh container bash -i gives you a shell)
The cause is that conf.c does not initialize mntflags.
Best regards Joerg


--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -880,7 +880,8 @@ static int parse_mntopts(const char *mntopts, unsigned 
long *mntflags,
char *s, *data;
char *p, *saveptr = NULL;
 
-   *mntdata = NULL;
+   *mntdata  = NULL;
+*mntflags = 0UL;
 
if (!mntopts)
return 0;

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


[lxc-devel] PATCH: lxc-ps works with systemd

2011-07-15 Thread Joerg Gollnick
Dear all,
while working with systemd I found that lxc-ps -efa does not recognize the 
container name.
Best regards Joerg

diff --git a/src/lxc/lxc-ps.in b/src/lxc/lxc-ps.in
index 249b104..4ef2296 100755
--- a/src/lxc/lxc-ps.in
+++ b/src/lxc/lxc-ps.in
@@ -37,7 +37,7 @@ our %LXC_NAMES;   # Specified container names (if any)
 
 sub get_container_names {
my $ref_names = shift;
-   my $lxcpath='@LXCPATH@';
+   my $lxcpath   = '@LXCPATH@';
 
open(active, "netstat -xa | grep $lxcpath |") or return;
while() {
@@ -112,13 +112,18 @@ sub get_container {
 my $pid = shift;
 my $filename = "/proc/$pid/cgroup";
 open(LXC, "$filename");
-my $container = ;
+# read all lines at once 
+my @cgroup = ;
 close LXC;
-chomp($container);
-if ($container =~ m/[:,]ns[:,]/o) {
-   $container =~ s/.*:\///o;
-} else {
-   $container ='';
+my $container = '';
+foreach ( @cgroup ) {
+chomp;
+# find the container name 
+if (m/[:,]ns[:,]/o) {
+   # container name after :/
+   s/.*:\///o;
+$container = $_;
+}
 }
 return $container;
 }





--
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-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel