<div dir="ltr"><div>I'm using xymon 4.3.17, and server is what does the ntpdate test. Here's the snippet of code in question:</div><div>                if (strchr(cmd, ' ') == NULL) execlp(cmd, cmd, NULL);</div><div>                else {</div><div>                        char *shell = getenv("SHELL");</div><div>                        if (!shell) shell = "/bin/sh";</div><div>                        execl(shell, "sh", "-c", cmd, NULL);</div><div>                }</div><div>                exit(127);</div><div><br></div><div>Note that 4.3.10 does what you say. I have that in the clients I have.</div><div><br></div><div>If I restart it as me, ntpdate is run, but not with an sh derivative. My shell is tcsh, and what I start uses my environment variables. My init script also has #!/bin/sh as the first line, but that doesn't necessarily prevent environment variables from being inherited. </div><div><div># echo $tcsh</div><div>6.18.01</div><div># sh</div><div># echo $SHELL<br></div><div>/bin/tcsh</div></div><div>I've added setting the shell to my startup script for now. And, to show you what's happening, here's a snippet that echoes $SHELL:</div><div><div>xymon_precmd()</div><div>{</div><div>        echo $SHELL</div><div>        SHELL="/bin/sh"</div><div>        export SHELL</div><div><br></div><div>        touch ${xymon_pidfile} && chown ${xymon_user} ${xymon_pidfile}</div><div>}</div></div><div><br></div><div>And so, even though the startup script is run with /bin/sh, the $SHELL variable is still set to /bin/tcsh:</div><div><div># /etc/rc.d/xymon restart</div><div>Stopping xymon.</div><div>Waiting for PIDS: 29042.</div><div>/bin/tcsh</div><div>Starting xymon.</div></div><div>#</div><div><br></div><div>-Tracy</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 11:43 PM, Jeremy Laidman <span dir="ltr"><<a href="mailto:jlaidman@rebel-it.com.au" target="_blank">jlaidman@rebel-it.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 17 October 2014 15:16, Tracy Di Marco White <span dir="ltr"><<a href="mailto:gendalia@iastate.edu" target="_blank">gendalia@iastate.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">If I restart xymon while using tcsh, for example, suddenly my ntp test breaks,</div></blockquote><div><br></div></span><div>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.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>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.</div></div></blockquote><div><br></div></span><div>Curiously, the code that runs the "ntpdate" command is this:</div><div><br></div><div>  execl("/bin/sh", "sh", "-c", cmd, NULL);<br></div><div><br></div><div>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.</div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div>Jeremy</div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div>