Advertisement
Guest User

cgroup fixer

a guest
Sep 5th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. file_obj = open(os.path.join(config.cgroups_path, i, config.child_cgroup, "freezer.state"), "w")
  2. file_obj.write("FROZEN")
  3. file_obj.close()
  4. #
  5. stacks = []
  6. for j in self.get_tasks(i):
  7.     j = int(j.strip())
  8.     #
  9.     file_obj_stack = open(os.path.join("/proc", str(j), "stack"), "r")
  10.     stack = file_obj_stack.read()
  11.     file_obj_stack.close()
  12.     stacks.append({"pid": j, "stack": stack})
  13.     #
  14.     os.kill(j, signal.SIGKILL)
  15. #
  16. file_obj = open(os.path.join(config.cgroups_path, i, config.child_cgroup, "freezer.state"), "w")
  17. file_obj.write("THAWED")
  18. file_obj.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement