Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file_obj = open(os.path.join(config.cgroups_path, i, config.child_cgroup, "freezer.state"), "w")
- file_obj.write("FROZEN")
- file_obj.close()
- #
- stacks = []
- for j in self.get_tasks(i):
- j = int(j.strip())
- #
- file_obj_stack = open(os.path.join("/proc", str(j), "stack"), "r")
- stack = file_obj_stack.read()
- file_obj_stack.close()
- stacks.append({"pid": j, "stack": stack})
- #
- os.kill(j, signal.SIGKILL)
- #
- file_obj = open(os.path.join(config.cgroups_path, i, config.child_cgroup, "freezer.state"), "w")
- file_obj.write("THAWED")
- file_obj.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement