Possible to pass env vars into chpst without envdir?
3
votes
2
answers
3941
views
I use runit to daemonize my web application, and I'm trying to see if I can have my process managed by
sv
not have to have a corresponding envdir
for its environment variables. I wonder if I can just pass those vars directly into my call to chpst
. This is the run
file under /etc/service/myapp
:
#!/bin/sh
exec 2>&1
cd /var/www/myapp
# what it currently looks like
exec chpst -u www-data:www-data /var/www/myapp/myapp
# what I'd ideally like to be able to do
FOO=bar BAZ=qux exec chpst -u www-data:www-data /var/www/myapp/myapp
As I mentioned, chpst
also comes with a -e
option to pass a directly with environment variables to it, I could use that, but I'm trying to avoid it for simplicity (fewer things to maintain). Is that at all possible? Tips?
Asked by Alexandr Kurilin
(2481 rep)
Feb 23, 2015, 07:53 PM
Last activity: Jun 18, 2020, 05:13 AM
Last activity: Jun 18, 2020, 05:13 AM