Passing environment variables from pre-start (or the shell) to exec

Scott James Remnant scott at netsplit.com
Fri Jun 1 09:43:54 BST 2007


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
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20070601/d51a66ab/attachment.pgp 


More information about the upstart-devel mailing list