Question about lifetime of environment variables in job files
Scott James Remnant
scott at netsplit.com
Tue Nov 4 19:09:18 GMT 2008
On Tue, 2008-11-04 at 14:31 +0100, Matthias Urlichs wrote:
> Scott James Remnant:
> > The idea would be that when the pre-start script exits, we pick up the
> > environment table and add that back to the job -- this may require some
> > changes to the way init gets child signals or something though.
> >
> Umm, so you want to either auto-add a "printenv" at the end of that
> script, or use ptrace to stop it before running _exit() / exit_group()?
>
Right, it's a bit tricky - the only real way to extract the "exported
environment" of a process is to make it fork a child, or exec another
binary.
I had a crazy idea of grabbing the child on exit, and then turning that
into an exec() call which fed back the information into Upstart.
An initctl "change the environment" command is far more likely as the
ultimate realisation here:
initctl saveenv
Maybe
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: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20081104/7c5b1120/attachment.pgp
More information about the upstart-devel
mailing list