LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-14-2020, 05:31 PM   #1
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
ssh-agent on -current: starts at Xfce login, never exits


Using Slackware64-current with recent updates, Xfce-4.14, login via xdm into xfce4 session, no KDE.

Every time I log in, ssh-agent starts. It does not stop when I log out. The number of ssh-agents currently running, as well as the number of /tmp/ssh-* directories, equals the number of times I have logged in since boot-up.

It looks like xfce4-session starts these up, but they are not exiting at logout like they should, for some reason.

I found that I can disable ssh-agent startup at login with this:

Code:
$ xfconf-query --channel xfce4-session --property /startup/ssh-agent/enabled --create --type bool --set false
Or re-enable it with this:
Code:
$ xfconf-query --channel xfce4-session --property /startup/ssh-agent/enabled --reset
I disabled it, since I don't seem to need it. But does anyone know why it isn't stopping at logout?
 
Old 12-17-2020, 08:55 AM   #2
mumahendras3
Member
 
Registered: Feb 2018
Location: Indonesia
Distribution: Slackware-current + s6 + s6-rc + s6-linux-init (github.com/mumahendras3/sl6ckware)
Posts: 125

Rep: Reputation: Disabled
Yep, I tried launching Xfce using startx and then logging out. The ssh-agent is not stopped here too. Maybe it's a normal behaviour? Since the ssh-agent is reparented to PID 1 (init) so the main Xfce process doesn't know its PID to be able to stop it properly at logout.

Interestingly, running
Code:
echo $SSH_AGENT_PID
in the terminal emulator inside Xfce prints out the PID of the started ssh-agent, which means that environment variable is already set and accessible by processes started by the user. I don't know why the main Xfce process doesn't use that environment variable to kill the started ssh-agent when the user logs out.

Probably not really helpful, just giving my thoughts.

Last edited by mumahendras3; 12-17-2020 at 10:32 AM. Reason: A couple rewordings
 
Old 12-17-2020, 06:57 PM   #3
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Original Poster
Rep: Reputation: Disabled
Thanks for your reply and checking on it. I did take a look at the xfce4-session source code, and found that there is a function for shutting down the session that kills off ssh-agent. But as far as I can tell it never gets called. I put some tracing print calls in there, and they never appeared; I searched the source code and found no place that calls it (xfsm_startup_shutdown()). The next step would be to open a bug on the xfce4-session tracker... I'm thinking about it.

As far as I understand, $SSH_AGENT_PID allows processes in your login session to communicate with the ssh-agent. Once you log out, the still-running ssh-agent is probably inaccessible because no process still has its PID in $SSH_AGENT_PID. Which makes the extra ones useless.
 
1 members found this post helpful.
Old 12-17-2020, 10:23 PM   #4
mumahendras3
Member
 
Registered: Feb 2018
Location: Indonesia
Distribution: Slackware-current + s6 + s6-rc + s6-linux-init (github.com/mumahendras3/sl6ckware)
Posts: 125

Rep: Reputation: Disabled
Quote:
Originally Posted by ljb643 View Post
As far as I understand, $SSH_AGENT_PID allows processes in your login session to communicate with the ssh-agent. Once you log out, the still-running ssh-agent is probably inaccessible because no process still has its PID in $SSH_AGENT_PID. Which makes the extra ones useless.
I think that should be $SSH_AUTH_SOCK, the path to the running ssh-agent's socket file. In KDE Plasma, I usually use $SSH_AGENT_PID to kill ssh-agent when logging out by putting "kill $SSH_AGENT_PID" in a shutdown script and put that script in $XDG_CONFIG_HOME/plasma-workspace/shutdown. Although after I was able to emulate systemd's user-level services functionality that start/stop user's services at user's login/logout using s6 + s6-rc together with elogind DBus interface, I just added ssh-agent to the list of services that should be started when I login and then deleted that shutdown script since it's not needed any more .

Last edited by mumahendras3; 12-18-2020 at 12:02 AM. Reason: Additional info
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Systemd starts gpg-agent mysteriously and does not end it with the last login session Alpha90 Linux - Security 6 05-30-2014 04:00 PM
[SOLVED] ssh-agent -> The agent has no identities. windstory Linux - Security 2 11-19-2008 06:45 PM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
end of file function never exits : C programming exvor Programming 6 10-05-2006 11:35 AM
Problems in installing FC 4/3/2 when installation starts the system exits abnormally bhaskarjha17 Linux - Newbie 1 02-02-2006 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration