From e74ab6c5b107e3daeb4fae3f59013856be060bad Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 21 Feb 2012 19:13:53 +0000 Subject: [PATCH] Use $SHELL environment variable to run the shell scripts. --- daemon/daemon.ml | 4 +++- daemon/whenjobsd.pod | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- 1.8.3.1