On Fri, Aug 30, 2024 at 13:45:43 +0200, Erwan David wrote:
> The after/wants does not work (starnge since ssh-agent.service seems
> to see the SSH_AUTH_SOCK variable.
> 
> But /etc/X11/Xsession.d/90x11-common_ssh-agent is a configuration file
> and we can add SSHARGS. I added a
> SSHARGS="-a $XDG_RUNTIME_DIR/ssh-agent"
> 
> Then I added an override to emacs.service
> Environment=SSH_AUTH_SOCK=%t/ssh-agent
> 
> And it works

It's amazing how badly the systemd folks managed to break *everything*.

I'm pretty old-fashioned.  I use startx from a console login, and I
configure it with a ~/.xsession file which overrides the Debian stuff.

In my .xsession file I have:

    hash ssh-agent 2>/dev/null && eval "$(ssh-agent -s)"
    hash ssh-add 2>/dev/null && ssh-add </dev/null

This launches an agent, and evaluates the output (variables defining
where the socket lives), exactly the way it's supposed to be done since
decades before systemd existed.

I invoke my window manager later in the .xsession file, so it inherits
the ssh-agent environment variables.  All of my X11 programs are children
of the window manager (or of this .xsession file), so *they* all inherit
the variables as well.

None of that "child of dbus" or "child of systemctl --user" bullshit
for me, thank you very much.

Reply via email to