Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 516848 - gnome-base/gnome-keyring-3.12.2-r1: Multiple keyring daemons running as root
Summary: gnome-base/gnome-keyring-3.12.2-r1: Multiple keyring daemons running as root
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 518566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-10 12:48 UTC by Albert W. Hopkins
Modified: 2015-11-14 09:11 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert W. Hopkins 2014-07-10 12:48:12 UTC
Sometimes I will have a multitude of gnome-keyring-daemons running as root:

    $ ps aux|grep ^root.*gnome-keyring-daemon|wc -l
    49

This, among other things, inhibits the ability for the user to shutdown the machine:

    $ systemctl poweroff
    User root is logged in on sshd.
    User root is logged in on sshd.
    User root is logged in on sshd.
    User root is logged in on sshd.
    User root is logged in on sshd.
    User root is logged in on sshd.
    [...]
    Please retry operation after closing inhibitors and logging out other users.
    Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.


Indeed, "loginctl" shows multiple root sessions open though I'm not logged in as root at all.

The thing that I *think* is causing this to happen is, I have another system that connects to the affected system via rsync+ssh as root to perform backups.  The ssh sessions never us X or anything gnome-specific, so I don't now why gnome-keyring-daemon would be launched.  Even though the ssh/rsync process has completed it seems the gnome-keyring-daemons persist.  I'm not sure how/why the ssh sessions would be launching gnome-keyring-daemon at all.

    gnome-base/gnome-keyring-3.12.2-r1  USE="caps filecaps pam ssh-agent -debug (-selinux) {-test}"
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-07-11 10:28:32 UTC
@systemd, any ideas why this might happen?
Comment 2 Albert W. Hopkins 2014-07-11 12:23:04 UTC
Here are some logs:

Jul 11 07:56:55 lighthouse sshd[234]: Accepted publickey for root from xxx.xxx.xx.xx port 48203 ssh2: RSA xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Jul 11 07:56:55 lighthouse sshd[57402]: pam_unix(sshd:session): session opened for user root by (uid=0)
Jul 11 07:56:55 lighthouse systemd[1]: Starting user-0.slice.
Jul 11 07:56:55 lighthouse systemd[1]: Created slice user-0.slice.
Jul 11 07:56:55 lighthouse systemd[1]: Starting User Manager for UID 0...
Jul 11 07:56:55 lighthouse systemd[1]: Starting Session c3 of user root.
Jul 11 07:56:55 lighthouse systemd[1]: Started Session c3 of user root.
Jul 11 07:56:55 lighthouse systemd-logind[199]: New session c3 of user root.
Jul 11 07:56:55 lighthouse systemd[57404]: pam_unix(systemd-user:session): session opened for user root by (uid=0)
Jul 11 07:56:55 lighthouse systemd[57404]: Starting Paths.
Jul 11 07:56:55 lighthouse systemd[57404]: Reached target Paths.
Jul 11 07:56:55 lighthouse systemd[57404]: Starting Timers.
Jul 11 07:56:55 lighthouse systemd[57404]: Reached target Timers.
Jul 11 07:56:55 lighthouse systemd[57404]: Starting Sockets.
Jul 11 07:56:55 lighthouse systemd[57404]: Reached target Sockets.
Jul 11 07:56:55 lighthouse systemd[57404]: Starting Basic System.
Jul 11 07:56:55 lighthouse systemd[57404]: Reached target Basic System.
Jul 11 07:56:55 lighthouse systemd[57404]: Starting Default.
Jul 11 07:56:55 lighthouse systemd[57404]: Reached target Default.
Jul 11 07:56:55 lighthouse systemd[57404]: Startup finished in 13ms.
Jul 11 07:56:55 lighthouse systemd[1]: Started User Manager for UID 0.
Jul 11 07:56:55 lighthouse gnome-keyring-daemon[57409]: couldn't connect to dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY
Jul 11 07:56:55 lighthouse gnome-keyring-daemon[57409]: couldn't connect to dbus session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY
Jul 11 07:56:55 lighthouse sshd[234]: Received disconnect from xxx.xxx.xx.xx: disconnected by user

$ sudo loginctl show-session -a c3
Id=c3
User=[unprintable]
Name=root
Timestamp=Fri 2014-07-11 07:56:55 EDT
TimestampMonotonic=79968641708
VTNr=0
Seat=[unprintable]
TTY=
Display=
Remote=yes
RemoteHost=blackwidow
RemoteUser=
Service=sshd
Desktop=
Scope=session-c3.scope
Leader=57402
Audit=0
Type=tty
Class=user
Active=yes
State=closing
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0

The "loginctl show-status" shows the session as "closing", but I don't know why it never closes.  The gnome-keyring-daemon[57409] persists even though it can't connect to a dbus session or $DISPLAY.  Shouldn't it just die?  Should it be launching to begin with?
Comment 3 Alexander Tsoy 2014-07-30 08:18:28 UTC
Same problem here. If I login on my machine via ssh and logout then gnome-keyring-daemon process remains running and I can see these sessions via loginctl.

$ sudo loginctl list-sessions
   SESSION        UID USER             SEAT            
         1       1000 puleglot         seat0           
       132       1000 puleglot                         
       133       1000 puleglot                         

3 sessions listed.
$ sudo loginctl session-status 132
132 - puleglot (1000)
           Since: Ср 2014-07-30 12:05:19 MSK; 12min ago
          Leader: 9161
          Remote: 10.253.11.231
         Service: sshd; type tty; class user
           State: closing
            Unit: session-132.scope
                  └─9904 /usr/bin/gnome-keyring-daemon --daemonize


But the main problem for me is that after this gnome-keyring-daemon cannot be used as ssh agent from the graphical gnome session:

$ ssh 192.168.2.67 
Agent admitted failure to sign using the key.
Password:

And following lines appears in the journal:

gnome-keyring-daemon[14890]: couldn't create system prompt: Error spawning command line 'dbus-launch --autolaunch=c445389dad1966ced583b8bb0000000d --binary-syntax --close-stderr': Child process exited with code 1
Comment 4 Alexander Tsoy 2014-07-30 08:39:08 UTC
Interesting.. Each gnome-keyring-daemon process uses the same path for ssh socket and recreates it. That's why login via ssh breaks gnome-keyring for gnome session:

$ ls -i /run/user/1000/keyring/ssh
878659 /run/user/1000/keyring/ssh

after next login via ssh:

$ ls -i /run/user/1000/keyring/ssh
878889 /run/user/1000/keyring/ssh

This is due to the change [1]

[1] https://git.gnome.org/browse/gnome-keyring/commit/?id=275a696131e41ea4be3d3ddf6690b8bcd0fe0105
Comment 5 Alexander Tsoy 2014-07-30 08:42:47 UTC
And the same problem with gpg keyring. All sockets gets recreated:

$ ls -1i /run/user/1000/keyring/
878887 control
878891 gpg
878894 pkcs11
878889 ssh
Comment 6 Alexander Tsoy 2014-07-30 09:02:08 UTC
Sorry for the noise, I filed a new bug 518566 about the sockets issue.
Comment 7 Alexander Tsoy 2014-07-30 09:25:06 UTC
(In reply to Alexandre Rostovtsev from comment #1)
> @systemd, any ideas why this might happen?

Let's remove pam_gnome_keyring from /etc/pam.d/system-login. This will fix both this bug and bug 518566.
Comment 8 Alexander Tsoy 2014-10-28 18:48:21 UTC
*** Bug 518566 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Tsoy 2014-10-28 18:49:58 UTC
(In reply to Alexandre Rostovtsev from comment #1)
> @systemd, any ideas why this might happen?

This issue is not specific to systemd. gnome-keyring-daemon gets started as a daemon on each login (even remote login).
Comment 10 Pacho Ramos gentoo-dev 2015-11-14 09:11:08 UTC
Please try with a fully updated system and gnome-keyring-3.16.0-r1 at least