log more stuff
[util-vserver-pl.git] / python / vserver.py
index c5464c5..59b3530 100644 (file)
@@ -138,7 +138,7 @@ def adjust_lim(goal, curr):
     if gm != VC_LIM_KEEP:
         if gm > soft or gm == resource.RLIM_INFINITY:
             soft = gm
-        if gm > hard or gs == resource.RLIM_INFINITY:
+        if gm > hard or gm == resource.RLIM_INFINITY:
             hard = gm
     if gs != VC_LIM_KEEP:
         if gs > soft or gs == resource.RLIM_INFINITY:
@@ -301,7 +301,7 @@ class VServer:
             try:
                 vserverimpl.unsetdlimit(self.dir, self.ctx)
             except OSError, e:
-                self.log("Unexpected error with unsetdlimit for context %d" % self.ctx)
+                self.log("Unexpected error with unsetdlimit for context %d -- %r" % (self.ctx,e))
             return
 
         if self.vm_running:
@@ -321,7 +321,7 @@ class VServer:
                                   vserverimpl.DLIMIT_INF,  # inode limit
                                   2)   # %age reserved for root
         except OSError, e:
-            self.log("Unexpected error with setdlimit for context %d" % self.ctx)
+            self.log("Unexpected error with setdlimit for context %d: %s" % (self.ctx, e))
 
 
         self.config.update('dlimits/0/space_total', block_limit)
@@ -501,6 +501,8 @@ class VServer:
                         if os.path.isfile(cmd[0]):                         
                             print >>log, "executing '%s'" % " ".join(cmd_args)
                             os.spawnvp(os.P_NOWAIT,cmd[0],cmd_args)
+                        else:
+                            print >>log, "WARNING: could not run %s"%cmd[0]
                     except:
                         print >>log, traceback.format_exc()