- logger.log_call(command, timeout=60)
-
- if os.path.exists(containerDir):
- # oh no, it's still here...
- logger.log("WARNING: failed to destroy container %s" % containerDir)
-
- logger.verbose('sliver_libvirt: %s destroyed.'%name)
-
+ logger.log_call(command, timeout=BTRFS_TIMEOUT)
+
+ # For some reason I am seeing this :
+ #log_call: running command btrfs subvolume delete /vservers/inri_sl1
+ #log_call: ERROR: cannot delete '/vservers/inri_sl1' - Device or resource busy
+ #log_call: Delete subvolume '/vservers/inri_sl1'
+ #log_call:end command (btrfs subvolume delete /vservers/inri_sl1) returned with code 1
+ #
+ # something must have an open handle to a file in there, but I can't find out what it is
+ # the following code aims at gathering data on what is going on in the system at this point in time
+ # note that some time later (typically when the sliver gets re-created) the same
+ # attempt at deleting the subvolume does work
+ # also lsof never shows anything relevant; this is painful..
+
+ if not os.path.exists(containerDir):
+ logger.log('sliver_lxc.destroy: %s cleanly destroyed.'%name)
+ else:
+ # we're in /
+ #logger.log("-TMP-cwd %s : %s"%(name,os.getcwd()))
+ # also lsof never shows anything relevant; this is painful..
+ #logger.log("-TMP-lsof %s"%name)
+ #command=['lsof']
+ #logger.log_call(command)
+ logger.log("-TMP-ls-l %s"%name)
+ command = ['ls', '-l', containerDir]
+ logger.log_call(command)
+ if os.path.exists(containerDir):
+ logger.log('sliver_lxc.destroy: ERROR could not cleanly destroy %s - giving up'%name)
+
+ if vsys_stopped: vsysStartService()