Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.49k stars 1.25k forks source link

Directory not searched for executable #369

Open mal opened 10 years ago

mal commented 10 years ago

EDIT: Re-parsing the docs I see this probably counts as "expected behavior" however it doesn't seem very obvious or clear, so perhaps this is more of a feature request.


I think this is because process.get_execv_args only checks my path for the executable and not the directory set by directory.

example

mal:~# ls -l /opt/hello/bin/hello
-rwxrwxr-x 1 mal mal 1088 Jan 29 14:27 /opt/hello/bin/hello
mal:~# sudo supervisorctl status
example          BACKOFF    can't find command 'bin/hello'
[program:example]
command = bin/hello
directory = /opt/hello
kuzmich commented 10 years ago

I can confirm this - supervisor [sometimes] can't find command with path relative to the directory, but you can run this command from the directory manually. As a workaround you can provide a full path to the command.

schemacs commented 9 years ago

I figure out the lines of code doing with this:

if "/" in program:
    filename = program
    try:
        st = self.config.options.stat(filename)
    except OSError:
        st = None

I want the /opt/hello/bin/hello to run if directory is set to a valid directory path. I create one pr But I don't know if this has any side effect.

ihipop commented 7 years ago

any update on this issue? @mnaberez

RobIsHere commented 7 years ago

I ran into this issue today. It celebrated its 3rd birthday this year ;)

Vladnev commented 6 years ago

Her guys, you have a ready-made PR. Problem exists 3-years :(

kgreenek commented 6 years ago

I just ran into this. Can confirm that it's still a problem in 2018.

Adding to this: I found a workaround (albeit less-than-ideal). Instead of directly running the application, run it in a shell. E.g.

[program:hello]
command=bash -c "exec bin/hello"
directory=/opt/hello
ihipop commented 6 years ago

@kgreenek this require a extra bash process

SaturnIC commented 1 year ago

8 years of this issue and no mention in the docs what directory really does.

I guess directory only affects environment variables and bash commands, but this is neither sensible nor documented.