Created attachment 3294 Patch with parent of 5758c9e244efc0f2c5d73d003e4fc0589c6d8e42 xfce-utils/scripts/xinitrc.in.in: Don't start ssh-agent and gpg-agent Users who want to start these agents can make use of the XDG autostart directories, $HOME/.xprofile, and/or the various distribution-specific methods to launch stuff on DE startup. Having these started by Xfce unnecessarily complicates things for users that want to use e.g. gnome-keyring's implementations of the ssh and/or gpg agent.
I don't really care about this, sounds ok. This is "geek" stuff anyway. Jannis, Nick, what do you think about this?
This was added for a reason; benny? olivier?
Yeah, I bet it has been added on purpose. I would like to know why out of a sudden this code is becoming a problem.
The problem is that there's no way to tell xfce that I want to use gnome-keyring as my ssh agent and/or gpg agent - it automatically starts ssh-agent and gpg-agent for me, regardless of whether that's what I want to use. Probably that was fine when those were the only options available -- if you wanted an agent at all, then that's what you used, and if you didn't want/need one, then no harm was done by starting them anyway. These days, there are options, and those options are even supported indirectly by xfce (enable gnome services on startup), so it seems like this should be something that the user sets up to start from $HOME/.profile, $HOME/.xprofile, or wherever.
The option to start ssh/gpg-agent using xinitrc can't work atm, as it relies on the xfconf key /startup/ssh-agent/enabled (in xfce4-session channel), and nothing in xfce4-session allows you to set that key. That is a first part of the issue. From my understanding, people wanting to use gnome-keyring should just set 'start gnome services', as it's exactly what it does (start gnome-keyring) Another way is to set SSH_ASKPASS in environment. But please, don't remove that part from xinitrc. We should readd a way to change the xfconf key to xfce4-session-settings though.
From what i understand, unless someone does xfconf-query -c xfce4-session -n -v -p /startup/ssh-agent/enabled -t bool -s true to set that key manually, xinitrc wont start ssh-agent. This was added in http://git.xfce.org/xfce/xfce-utils/commit/?id=47b3b58052dbdb6424c6303989727eaac02aab41 but nothing more was done to integrate it into the ui.
if 'start gnome services' starts gnome-keyring. That option should probably disable {ssh,gpg}-agent
This is the same thing than consolekit. Imho it's not Xfce role to determine if the user wants or not those daemon to be started. Some of them (xscreensaver for example) should be started from .config/autostart since they don't need to export anything to the environment. The other (*-agent, consolekit etc.) should install themselves their startup file and agree on a way for the user to select this. But it has to be cross-distro and cross-desktop or it won't really work. Debian does it using scripts (installed by packages themselves) in /etc/X11/Xsession.d and global configuration in /etc/X11/Xsession.options. There's no support for a $HOME/.Xsession.options but I guess that might be possible. All in all, I think this should happen on freedesktop.org list (either X, distrib@ or a cross-desktop) one (fd.o is not Linux-specific, is it?)
If the shutdown of the agent is not required, we can move this to autostart.
(In reply to comment #9) > If the shutdown of the agent is not required, we can move this to autostart. Please note that ssh/gpg-agents cannot be handled through xdg autostart mechanisms since they must set environment variables for the session, in case of gnome-keyring these are passed through a DBus interface to the GNOME session manager.
But we can easily add that to the session manager. So then autostart would be a nicer solution i guess.
(In reply to comment #11) > But we can easily add that to the session manager. So then autostart would be a > nicer solution i guess. Only gnome-keyring supports this DBus interface, the only generic way supported by ssh-agent/gpg-agent/gnome-keyring is to read the environment variables they print to stdout and to put them in the environment of the session manager (i.e. what the script used to do). I don't see any nice way to accomplish that with xdg autostart files. xfce4-session already already uses the above method to start gnome-keyring when GNOME compatibility mode is enabled (although that currently has undesired side effects see bug #8014), this could be made more generic with a new configuration option for the GPG/SSH agent to start on login.
Cooked this in the session manager.
Forgot to ask, but maybe some people can try the new code before 4.10. I've used it here and everything seems to work fine, but some more testing would be nice. The /startup/ssh-agent/enabled and /startup/ssh-agent/type properties still work.