Xymon Mailing List Archive search

function run_command in ../lib/run.c assumes sh but uses any $SHELL

list Jeremy Laidman
Fri, 17 Oct 2014 15:43:31 +1100
Message-Id: <user-dddfc83a5d49@xymon.invalid>

On 17 October 2014 15:16, Tracy Di Marco White <user-4d3c8321d54f@xymon.invalid> wrote:
If I restart xymon while using tcsh, for example, suddenly my ntp test
breaks,
Is this a client or server?  How did you restart xymon?  My init script has
"#! /bin/sh" in the first line, so I don't think it should matter what
shell I run it from.

For the moment, I've hard coded 'export SHELL=/bin/sh' in the startup
script for xymon, but the assumption shouldn't be made that $SHELL is a
/bin/sh derivative.
Curiously, the code that runs the "ntpdate" command is this:

  execl("/bin/sh", "sh", "-c", cmd, NULL);

where "cmd" is the command (passed into the run_command() function.  So,
I'm perplexed why it should matter what shell is running.  As far as I can
tell, none of Xymon's binaries or scripts reference $SHELL.

Cheers
Jeremy