Re: variables in the run script

From: Subba Rao <umroute_at_tanucoo.com>
Date: Thu, 10 Oct 2013 21:18:47 +0200

Thank you everyone for replying!

I am running runit on Raspbian. As most of you have mentioned that the
starting #!/bin/sh was the problem. Raspbian uses another shell called
"dash". I changed the #!/bin/sh to #!/bin/bash and then the "run"
script was getting the RANDOM number. My "run" script is working as it
meant to be.

Thank you all for the wonderful suggestions as well.

Regards,

Subbarao

On 10/9/13 11:35 AM, Laurent Bercot wrote:
> 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.
>
Received on Thu Oct 10 2013 - 19:18:47 UTC

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