Thanks.  I tried it, but there is a problem.

The startup script has this:

    sudo -u foo ./foo

and the stdout log for the program has:

    sudo: sorry, you must have a tty to run sudo

I don't know how to work around that.

--steve


On 8/30/14 at 10:14 AM, akfsu...@fullford.com pronounced:

Steve,

You should be able to get Supervisor to manage the program ok via a startup script as long as the script execs "foo" instead of running it as a subprocess. Ie, the very last thing the script would do is:

exec ./foo

The effect is that "foo" replaces the startup script as far as Supervisor is concerned, so it will see SIGCHLD if "foo" exits and a wait() will reap the exit status of "foo" itself, plus the pid that Supervisor has will be foo's pid, so Supervisor can send it signals.

That said, I'm on this list to learn more about Supervisor and there may well be better ways to handle this case.

a.

On Aug 29, 2014, at 10:14 PM, Steve Piercy - Website Builder 
<w...@stevepiercy.com> wrote:

Is there any way to change the working directory in a [program:foo] stanza?

If that ain't possible, here's the problem I am trying to solve.

The binary program "foo" lacks documentation of how to start it directly with 
the secret
combination of correct flipped bits and values. There are startup shell scripts available which set the user, umask, and some environment variables (HOME, LC_ALL, LD_LIBRARY_PATH), but every shell script changes the working directory first, then invokes the command to start the binary:

./foo

When I try to start the binary with the fully qualified path through Supervisor:

[program:foo]
command=/usr/local/directory/foo
umask=002
user=foo
environment=HOME="/usr/local/directory",LC_ALL="en_US", LD_LIBRARY_PATH="baz"

foo will start, but Supervisor cannot stop or restart it.

Any help would be immensely appreciated.  Thank you!

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<w...@stevepiercy.com>               <http://www.StevePiercy.com/>

_______________________________________________
Supervisor-users mailing list
Supervisor-users@lists.supervisord.org
https://lists.supervisord.org/mailman/listinfo/supervisor-users

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<w...@stevepiercy.com>               <http://www.StevePiercy.com/>

_______________________________________________
Supervisor-users mailing list
Supervisor-users@lists.supervisord.org
https://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to