def submit(self):
# `chmod +x' first, because we will execute the script locally
os.chmod(self._script_filename,
os.stat(self._script_filename).st_mode | stat.S_IEXEC)
# Run from the absolute path
self._f_stdout = open(self.stdout, 'w+')
self._f_stderr = open(self.stderr, 'w+')
# The new process starts also a new session (session leader), so that
# we can later kill any other processes that this might spawn by just
# killing this one.
self._proc = os_ext.run_command_async(
os.path.abspath(self._script_filename),
stdout=self._f_stdout,
stderr=self._f_stderr,
start_new_session=True)
# Update job info
self._jobid = self._proc.pid
评论列表
文章目录