Passing environment variables from pre-start (or the shell) to exec
Alexandros Kostopoulos
akostop at inaccessnetworks.com
Fri Jun 1 10:43:59 BST 2007
Yes, you're right. That's what I've already done (but unfortunately, after
posting this message...Sorry about that.
Alex
On Fri, 01 Jun 2007 11:43:54 +0300, Scott James Remnant
<scott at netsplit.com> wrote:
> On Thu, 2007-05-31 at 14:02 +0300, Alexandros Kostopoulos wrote:
>
>> I have several issues, but I'm trying to work them out as best as
>> possible. One of these is the following: I want to be able to pass
>> environment variables from the shell (or at least from the pre-start
>> script) to the exec stanza. For example, I want to run httpd, which
>> takes
>> several options, like -p <port>. These settings are stored in a file,
>> e.g,
>> /etc/default/httpd. I must source this file in pre-start to get the
>> environment variables and then use exec httpd -p $PORT.
>>
> Why must you source this in pre-start? Can't you do:
>
> script
> . /etc/default/httpd
> exec httpd -p $PORT
> end script
>
> Scott
More information about the upstart-devel
mailing list