Re: supervise environment

Mariano Absatz <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
On 10/17/05, Robin Bowes <[email protected]> wrote:
> Am I right in thinking that processes started by supervise will have an
> empty environment?
>
> Specifically, if I run a command using setuidgid, that shell running
> that command will not have the $HOME env var set unless I explicitly set
> it in the run file, e.g.
>
> export HOME=/home/slimserver
> exec /usr/local/bin/setuidgid $SLIMSERVER_USER $SLIMSERVER_BIN \
>    $SLIMSERVER_ARGS $SLIMSERVER_DEBUG 2>&1
>
You might like to look into envdir
(http://cr.yp.to/daemontools/envdir.html) for these kind of things...
at least, that is what djb usually uses, you then can put a file named
"HOME" in /home/slimserver/env with only one line in it that says
"/home/slimserver" and change your run script to

exec /usr/local/bin/setuidgid $SLIMSERVER_USER \
    /usr/local/bin/envdir  /home/slimserver/env $SLIMSERVER_BIN \
    $SLIMSERVER_ARGS $SLIMSERVER_DEBUG 2>&1

or something along the lines...

--
Mariano Absatz - El Baby
el (dot) baby (AT) gmail (dot) com
el (punto) baby (ARROBA:@) gmail (punto) com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.