Re: variables in the run script

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Wed, 09 Oct 2013 10:35:32 +0100

On 09/10/2013 08:58, Peter Pentchev wrote:
> Can you post your *entire* exact script, including the shebang line?
>
> If you do not have a shebang line, then try adding '#!/bin/bash' as
> the first line of your script - and yes, since you're using
> Bash-specific features, you do need to specify #!/bin/bash to make sure
> that nothing tries to run your script using, say, /bin/sh, which might
> be Bash or it might not be Bash, or it might be Bash behaving strangely
> because it has been invoked as /bin/sh, or who knows what else :)

  My instinct tells me that Peter is spot on.
  Scripts behave differently when run from a user shell and from a run
script because those are two widely different environments - which is part
of the point of using a supervision tree to manage your processes - and
the devil usually is in the seemingly irrelevant details.

  As a stylistic note: you do not need to loop in a run script. Just execute
the script once, finishing with "exec sleep $zzz". Your supervisor will
run it again when sleep exits. Think of a run script as something you would
run from a crontab, except it performs the sleeping itself.

-- 
  Laurent
Received on Wed Oct 09 2013 - 09:35:32 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC