[14:33] <Trevinho> Hi, we've a problem when trying to run unity with upstart at session level.... The fact is that it doesn't, *weirdly* seem to inherit some env variables that are set when gnome-session launches the autostart programs (such as gnome-keyring-daemon)
[14:34] <Trevinho> Basically, what happens is that both unity and unity-settings-daemon are launched "on starting gnome-session", but once all it's loaded
[14:35] <Trevinho> if I open a terminal from unity, then these env variables are not set (env | grep key should show you the one I mean)
[14:35] <Trevinho> instead, if I do ctrl+alt+t (which causes unity to make unity-settings-daemon to open a terminal), then these are set correctly
[14:36] <Trevinho> And the werid thing is that both processess seems (after some debugging) to be launched just before gome-session... But unity doesn't get all the env varialbes it should
[14:37] <Trevinho> also, gnome session has a dbus call to set/unset env variables and I was wondering if I should bind these calls to set the envs also at upstart level, but they don't seem to be set globally... I mean, not in the terminals I have opened at least
[14:46] <jodh> Trevinho: have you compared 'env' with 'initctl list-env'? The session init will by default inherit all variables from the environment that started it and job will be given that environment, plus any variables set with 'initctl set-env key=value' so it may be you need to adjust the time particular jobs start to ensure that any 'initctl set-env's happen before gnome starts autostarting .desktop apps.
[14:49] <Trevinho> jodh: well I've tried to launch unity after that gnome-session has set these variables, but then at that point these variables are not set at all (while if I make it launch before they only are set "partially")...
[14:50] <Trevinho> jodh: but still I'm wondering why a process that starts before it (unity-settings-daemon) will inherit it, while unity doesn't
[14:52] <jodh> Trevinho: I'm confused. Are you saying gnome-session.conf is calling 'initctl set-env'? If it is, does 'initctl list-env' from any terminal show that the vars were set? Might be easier if you raise a bug with just the basic issue as I'm getting confused by all the unity and gnome stuff I'm afraid :-
[14:53] <Trevinho> jodh: no, gnome-session is not calling that.... Gnome-session runs some autostart scripts that then set env variables
[14:53] <jodh> Trevinho: how are they setting env vars exactly?
[14:55] <Trevinho> jodh: I've not checked the internals yet, but there's a gnome-session dbus call for doing that, and I guess that when it's done, gnome-session sets these envs at its level, at that point all the apps it has launched will use them
[14:55] <Trevinho> jodh: btw explaing this is probablty harder than seeing it.
[14:55] <Trevinho> jodh: you can easily test this by:
[14:55] <Trevinho>  sudo sed "s/compiz;//" -i /usr/share/gnome-session/sessions/ubuntu.session
[14:55] <Trevinho> jodh: then if you reload your unity session, you will see that if you use ctrl+alt+t launches a terminal with different env than if you run it from unity launcher/dash
[14:56] <jodh> Trevinho: I'm struggling to see how this is an upstart issue if gnome-session's autostarted apps are making env setting dbus calls on gnome-session?
[14:58] <Trevinho> jodh: I'm not saying it's an upstart issue :), I'm just wondering how I can fix this, since we'd like to use upstart to launch unity for multple reasons, but currently we can't do it as it would break the gnome-keyring-daemon env vars
[14:59] <jodh> Trevinho: might be a question for the desktop team then as they understand the gnome stack more than I do :) How about raising a bug and assigning to upstart + gnome for discussion?
[15:00] <Trevinho> jodh: ok
[15:00] <xnox> Trevinho: with unity, I thought "unity-session" is supposed to be used, not gnome-session.
[15:01] <xnox> Trevinho: also we are working on a fix to get gnome-keyring agents to be spawned correct under upstart and have their environmental variables available everywhere.
[15:01] <Trevinho> xnox: no, we use gnome-session with a unity profile
[15:01] <jodh> Trevinho: I really think this discussion should be on #ubuntu-desktop.
[15:01] <Trevinho> jodh: ok
[21:02] <jose> hey, everyone! I'm doing 'setuid username' (with a valid username on the system) for an upstart job and it says '/proc/self/fd/9: 2: /proc/self/fd/9: setuid: not found'
[21:02] <jose> any idea on what may be happening?
[21:08] <jose> found the error, thanks!