Run jobs with 'set -e' so that they exit on error.
[whenjobs.git] / daemon / daemon.ml
index 6f5edfb..6ccfcce 100644 (file)
@@ -353,6 +353,7 @@ and run_job job =
     (* Create a temporary file containing the shell script fragment. *)
     let script = dir // "script" in
     let chan = open_out script in
     (* Create a temporary file containing the shell script fragment. *)
     let script = dir // "script" in
     let chan = open_out script in
+    fprintf chan "set -e\n"; (* So that jobs exit on error. *)
     output_string chan job.job_script.sh_script;
     close_out chan;
     chmod script 0o700;
     output_string chan job.job_script.sh_script;
     close_out chan;
     chmod script 0o700;