How can I set the PATH for supervisord so it finds the executables

Emil Ivanov picture Emil Ivanov · Aug 25, 2011 · Viewed 7.1k times · Source

I'm trying to setup supervisor.conf. One of my apps requires node.js, but node is not installed system wise. Also, because it needs to bind to port 80 it need to run as root. How can I modify the PATH variable so that supervisord can find the node executable (which is located in a directory) and run the node.js app.


I'm trying to do it like this

[supervisord]
environment=PATH=/path/to/where/node/executable/is

[program:web]
command=node web.js -c config.json

This fails with

2011-08-25 16:49:29,494 INFO spawnerr: can't find command 'node'

Answer

zenbeni picture zenbeni · Nov 13, 2013

You can add it in the command using env:

[program:web]
command=env PATH="/path/to/where/node/executable/is" node web.js -c config.json

It seems environment does not work on some cases.