On 26/08/2024 18:37, Erwan David wrote:
On 23/08/2024 23:30, Max Nikulin wrote:It is started by /etc/X11/Xsession.d/90x11-common_ssh-agent The question is why emacs.service is started before /usr/lib/openssh/agent-launch or plasma copies SSH_AUTH_SOCKET value to systemd environment.
[...]
Alas it does not work.
Sounds like a race between code that copies environment and starting emacs. Have you tried to disable ssh-agent in Xsession to start it from systemd? Without it I am not sure that the following is really reliable:
[Unit] After=dbus.service ssh-agent.service Wants=dbus.service ssh-agent.service [Install] WantedBy= WantedBy=graphical-session-pre.target