Supervisor: Directory not searched for executable

Created on 29 Jan 2014  路  7Comments  路  Source: Supervisor/supervisor

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

Most helpful comment

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

All 7 comments

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.

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.

any update on this issue? @mnaberez

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

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

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

@kgreenek this require a extra bash process

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ramary picture ramary  路  33Comments

ivan1986 picture ivan1986  路  49Comments

gregpinero picture gregpinero  路  29Comments

cclauss picture cclauss  路  62Comments

ojii picture ojii  路  20Comments