Stéphane Graber has proposed merging
lp:~stgraber/upstart/upstart-inherit-env-no-override into lp:upstart.
Requested reviews:
Upstart Reviewers (upstart-reviewers)
For more details, see:
https://code.launchpad.net/~stgraber/upstart/upstart-inherit-env-no-override/+merge/148362
When preparing the test PPA for user session, I noticed that I had a problem
with the new environment inheriting feature.
In my test case, I had DBUS_SESSION_BUS_ADDRESS set in the parent environment,
so upstart with --inherit-env stored that value.
I then used initctl set-env to set it to another value, but this would never be
propagated to the new jobs.
The reason for this is because the inherited environment was appended after any
other environment variables and so would effectively override the "right"
variable as was defined through initctl.
This change simply changes the logic to always apply the inherited environment
first, then have any other environment variables override it.
NOTE: This change is already part of my current PPA packages.
--
https://code.launchpad.net/~stgraber/upstart/upstart-inherit-env-no-override/+merge/148362
Your team Upstart Reviewers is requested to review the proposed merge of
lp:~stgraber/upstart/upstart-inherit-env-no-override into lp:upstart.
=== modified file 'init/job_process.c'
--- init/job_process.c 2013-02-11 08:50:24 +0000
+++ init/job_process.c 2013-02-14 02:58:20 +0000
@@ -271,15 +271,14 @@
* so that initctl can have clever behaviour when called within them.
*/
envc = 0;
- if (job->env) {
- env = NIH_MUST (nih_str_array_copy (NULL, &envc, job->env));
- } else {
- env = NIH_MUST (nih_str_array_new (NULL));
- }
+ env = NIH_MUST (nih_str_array_new (NULL));
if (user_mode && inherit_env)
NIH_MUST(environ_append (&env, NULL, &envc, TRUE, environ));
+ if (job->env)
+ NIH_MUST(environ_append (&env, NULL, &envc, TRUE, job->env));
+
if (job->stop_env
&& ((process == PROCESS_PRE_STOP)
|| (process == PROCESS_POST_STOP)))
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel