From: Richard W.M. Jones Date: Tue, 21 Feb 2012 19:13:53 +0000 (+0000) Subject: Use $SHELL environment variable to run the shell scripts. X-Git-Tag: 0.0.1~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e74ab6c5b107e3daeb4fae3f59013856be060bad;p=whenjobs.git Use $SHELL environment variable to run the shell scripts. --- diff --git a/daemon/daemon.ml b/daemon/daemon.ml index 1155f50..6f5edfb 100644 --- a/daemon/daemon.ml +++ b/daemon/daemon.ml @@ -357,8 +357,10 @@ and run_job job = close_out chan; chmod script 0o700; + let shell = try getenv "SHELL" with Not_found -> "/bin/sh" in + (* Execute the shell script. *) - (try execvp "bash" [| "bash"; "-c"; script |]; + (try execvp shell [| shell; "-c"; script |]; with Unix_error (err, fn, _) -> Syslog.error "%s failed: %s: %s" fn script (error_message err) ); diff --git a/daemon/whenjobsd.pod b/daemon/whenjobsd.pod index 938358b..182a62d 100644 --- a/daemon/whenjobsd.pod +++ b/daemon/whenjobsd.pod @@ -101,6 +101,11 @@ from the L tool. The user's home directory. This directory must exist and must be owned by the same user as the daemon. +=item C<$SHELL> + +The shell used to execute shell scripts. If not set, C is +used. + =back =head1 SEE ALSO