[12:34] <tkd> hi, quick question - is there a way to have an upstart job load env vars from a file other than changing the exec to script and actually loading them there?
[13:47] <jodh> tkd: for system jobs, not really, but you can do magic with session jobs using 'initctl set-env': http://upstart.ubuntu.com/cookbook/#initctl-set-env
[14:02] <tkd> jodh: oh well. will have to change to script then.
[14:03] <jodh> tkd: you can set variables using the 'env' stanza of course, but not wholesale from a file.
[14:10] <tkd> yeah - this is for a managed deploy where i want to have a static upsart .conf and a separate /etc file with the actual settings
[14:10] <tkd> i was hoping i could do something like the systemd EnvironmentFile
[14:12] <jodh> tkd: actually, there is a way to do what you want then: create your static foo.conf
[14:13] <jodh> tkd: then create foo.override containing multiple 'env $name=$value' lines.
[14:18] <tkd> jodh: oh, that sounds pretty good. will check it out
[14:32] <jodh> tkd: It's now in the cookbook: http://upstart.ubuntu.com/cookbook/#separating-variables-from-the-job
[14:42] <allaire> Hi, can somebody explain me why these two are differents: https://gist.github.com/allaire/ab0e4900da999983ff21  the second one, with no `exec` command returns the wrong pid, always the pid just before the correct one
[14:43] <allaire> Also, is the way I handle the pid in a file correct? I was curious how it was possible to know the pid ($$) before actually running the exec command
[14:44] <jodh> allaire: please read http://upstart.ubuntu.com/cookbook/#expect
[14:46] <allaire> jodh: In my case I have both a script and an exec, I guess it takes the last one it encounter? Thanks for the link by the way
[15:05] <jodh> allaire: the correct one is probably the one with the 'exec'. Note that *that* exec is a shell keyword, not the upstart exec stanza :)
[15:07] <allaire> jodh: Yes that the correct one (the one with the exec). I thought it was the upstart exec, now I'm lost :(
[15:09] <jodh> allaire: when upstart sees a "script ... end-script" block, it runs it via /bin/sh. exec is a shell builting (see man sh / help exec).
[15:12] <allaire> from the man page, it's the same as running "./myscript", but how come I get a different pid depending of if I use it or not?
[15:17] <jodh> allaire: no, it isn't - exec *replaces* the current shell process with the command you run.
[15:18] <jodh> allaire: try logging in on a console and running "false". this just returns 1. Now try running "exec false" and see how it logs you out?
[15:19] <allaire> yea
[15:19] <allaire> I seee
[15:20] <allaire> so even if I have the "$$" var before the exec, it takes oveer the current shell process and that's why it has the right pid?
[15:21] <allaire> because $$ don't return the same thing if I have exec and if I don't