Skip to content

Commit

Permalink
Merge pull request #85 from njzjz/nohup
Browse files Browse the repository at this point in the history
use nohup to submit shell jobs
  • Loading branch information
njzjz committed Jul 5, 2021
2 parents 3e42c79 + cadf6c5 commit f200f98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dpdispatcher/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def do_submit(self, job):
script_str = self.gen_script(job)
script_file_name = job.script_file_name
job_id_name = job.job_hash + '_job_id'
output_name = job.job_hash + '.out'
self.context.write_file(fname=script_file_name, write_str=script_str)
ret, stdin, stdout, stderr = self.context.block_call('cd %s && echo $$ && exec bash %s &' % (self.context.remote_root, script_file_name) )
ret, stdin, stdout, stderr = self.context.block_call('cd %s && { nohup bash %s 1>>%s 2>>%s & } && echo $!' % (self.context.remote_root, script_file_name, output_name, output_name) )
if ret != 0:
err_str = stderr.read().decode('utf-8')
raise RuntimeError\
Expand Down

0 comments on commit f200f98

Please sign in to comment.