On Sat, Dec 28, 2013 at 04:45:38PM -0800, Russ Allbery wrote:
> After some more experimentation (the documentation doesn't say clearly
> whether pre-start can expose environment variables to exec or not), it
> looks like a better approach is:
> expect stop
> pre-start script
> test -x /usr/sbin/lbcd || { stop; exit 0; }
> if [ -f /etc/default/lbcd ] ; then
> . /etc/default/lbcd
> fi
> end script
> # To change the default lbcd service, specify a command to run for the
> # weight and interval, or do round-robin (-R), set the desired flags
> # in DAEMON_OPTS in /etc/default/lbcd.
> exec /usr/sbin/lbcd -f -l -Z $DAEMON_OPTS
> This seems to work and is what I will be uploading.
Hmm, It seems to not be what you uploaded in practice... which stands to
reason, since in fact no, the pre-start script cannot export environment
variables to the main process (for standard unixy reasons - upstart doesn't
do anything magical here to try to tie the process environments together, so
when the pre-start script exits, its environment goes with it. This could
be documented better). I guess you figured this out after having written
this mail?
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
Attachment:
signature.asc
Description: Digital signature