Closed nickstenning closed 8 years ago
@migurski Could you check this out and let me know if it correctly addresses the issue for you?
Thanks Nick! I checked again with Python 2.7.6 on Ubuntu 14.04. At 84a1f7d it generated a correct script, at d8be8f4 and it generated a bad one, and with your recent efd6292 and it generated this improved working script:
start on starting honcho-stuff
stop on stopping honcho-stuff
respawn
env VAR='foo bar'
env PORT=5000
exec su - migurski -m -s /bin/sh -c 'cd /home/migurski/honcho; exec python /home/migurski/honcho/stuff.py >> /var/log/honcho/stuff-1.log 2>&1'
I’ve updated https://github.com/nickstenning/honcho/pull/154, though with the file honcho/test/integration/test_export.py
gone I’m not sure it will have an effect.
Thanks for the feedback @migurski. This'll be in the next release.
As reported by #151, the quoting of environment variable values in Upstart configs is currently broken in the general case.
Correctly quoting variable values in the current context (i.e. already inside single quotes) is possible, but extremely messy, and results in hugely nested quotes when those values contain single quotes.
Instead, move the definition of the environment variables into the body of the Upstart config using the
env
directive, and add the-m
option tosu(1)
so that environment variables are passed through to the shell process.Closes #151. Closes #154.