4

Folks,

I'm trying to move something into a docker container, which means a shift from running it as a daemon into a stand alone process controlled by supervisord. Now I don't have much experience with supervisord so it's likely a simple configuration error on my part.

The problem stems from that this application needs certain environment variables set. When running as a daemon I'd set them via a bash script

#!/bin/bash
ORACLE_HOME=/home/oracle/app/
TNS_ADMIN=/home/oracle/app/network/admin
export ORACLE_HOME TNS_ADMIN
export LD_LIBRARY_PATH=$PATH:/home/oracle/app/lib
ncftpd_authd

In supervisord.conf I set it up as

[program:authd]
environment=ORACLE_HOME="/home/oracle/app/",TNS_ADMIN="/home/oracle/app/network/admin",export ORACLE_HOME TNS_ADMIN,export LD_LIBRARY_PATH="$PATH:/home/oracle/app/lib"
command=/usr/local/sbin/ncftpd_authd
stdout_events_enabled=true
stderr_events_enabled=true

However if I call supervisord -c /etc/supervisord.conf I get an error

[root@0d7f9a5d7c3a src]# supervisord -c /etc/supervisord.conf 
Error: Unexpected end of key/value pairs

I believe it's related to environment line as if I comment that out supervisord will start (but the authd won't run). What am I doing wrong in setting up the environment in the supervisord conf file?

1
  • You don't (I think) want the exports in that line. Change it to just a list of name=value. Aug 5, 2015 at 6:18

1 Answer 1

3

environment should be a list of key/value pairs, which means that it shouldn't contain export. The correct value would be:

environment=ORACLE_HOME="/home/oracle/app/",TNS_ADMIN="/home/oracle/app/network/admin",LD_LIBRARY_PATH="$PATH:/home/oracle/app/lib"

You may also need to replace $PATH by its value. Or, you can follow the standard of writing variable from outside in http://supervisord.org/configuration.html?highlight=environment. In short, to use $PATH, just write %(ENV_PATH)s. Then, it would be like this:

environment=ORACLE_HOME="/home/oracle/app/",TNS_ADMIN="/home/oracle/app/network/admin",LD_LIBRARY_PATH="%(ENV_PATH)s:/home/oracle/app/lib"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .