You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 07:37:04 UTC
svn commit: r1131818 - /incubator/mesos/trunk/src/lxc_isolation_module.cpp
Author: benh
Date: Sun Jun 5 05:37:04 2011
New Revision: 1131818
URL: http://svn.apache.org/viewvc?rev=1131818&view=rev
Log:
Check for LXC tools before running LXC isolation module.
Modified:
incubator/mesos/trunk/src/lxc_isolation_module.cpp
Modified: incubator/mesos/trunk/src/lxc_isolation_module.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/lxc_isolation_module.cpp?rev=1131818&r1=1131817&r2=1131818&view=diff
==============================================================================
--- incubator/mesos/trunk/src/lxc_isolation_module.cpp (original)
+++ incubator/mesos/trunk/src/lxc_isolation_module.cpp Sun Jun 5 05:37:04 2011
@@ -1,5 +1,8 @@
#include "lxc_isolation_module.hpp"
+#include <stdlib.h>
+#include <unistd.h>
+
#include <algorithm>
#include "foreach.hpp"
@@ -30,6 +33,12 @@ LxcIsolationModule::LxcIsolationModule(S
this->slave = slave;
reaper = new Reaper(this);
Process::spawn(reaper);
+
+ // Run a basic check to see whether Linux Container tools are available
+ if (system("lxc-version > /dev/null") != 0) {
+ PLOG(FATAL) << "Could not run lxc-version; make sure Linux Container "
+ << "tools are installed";
+ }
}