gnome-keyring-daemon couldn't access control socket: /var/run/user/1001/key

Well, in my inexpert opinion, the problem maybe that the file known as "key" isn't being created within the 1001 directory.

I've tried delaying the start of the gnome-keyring-daemon, but not sure if I'm doing it correctly.

I've located two files within /home/user/.config/autostart/ which seem to be related to launching the gnome-keyring-daemon, but apparently whatever I did had no effect. Below are the two auto start files I attempted to modify. I even tried creating a blank file named "key" but that also didn't seem to do anything.

/home/user/.config/autostart/gnome-keyring-pkcs11.desktop
Code:
[Desktop Entry]
X-XFCE-Autostart-Override=true
sleep 5 && /usr/local/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh

and

/home/user/.config/autostart/gnome-keyring-secrets.desktop
Code:
[Desktop Entry]
X-XFCE-Autostart-Override=true
sleep 5 && /usr/local/bin/gnome-keyring-daemon --start

So, I'm pretty certain that I must be dealing with the so called race problem, but it appears that the solution is just beyond my fingertips. I did find some info online, but the solutions I found didn't seem to work with the lightdm greeter. Any info greatly appreciated.
 
Well, I've managed to make some progress. I now longer have any lines related to gnome-keyring-daemon within /var/log/messages, but now my greeter (lightdm) is no longer asking for a password. Hmm...
 
Are you using GNOME or Xfce? It is no clear!

Instead of reinventing the wheel, why not to use .xprofile. x11/gnome-shell provides this file, read
pkg-message everything is explained. And .xinitrc is not used by GNOME for long time, neither by gdm.

A full gnome shell session launches automatically the gnome-keyring daemon (it is covered by XDG portal backend, here gnome).

But with LightDM login manager you need to modify (at least) /usr/local/etc/pam.d/lightdm.

Code:
# auth
[...]
auth    optional    /usr/local/lib/pam_gnome_keyring.so

# account
[...]

# session
[...]
session    optional    /usr/local/lib/pam_gnome_keyring.so    auto_start

# password
[...]
 
Are you using GNOME or Xfce? It is no clear!

Instead of reinventing the wheel, why not to use .xprofile. x11/gnome-shell provides this file, read
pkg-message everything is explained. And .xinitrc is not used by GNOME for long time, neither by gdm.

A full gnome shell session launches automatically the gnome-keyring daemon (it is covered by XDG portal backend, here gnome).

But with LightDM login manager you need to modify (at least) /usr/local/etc/pam.d/lightdm.

Code:
# auth
[...]
auth    optional    /usr/local/lib/pam_gnome_keyring.so

# account
[...]

# session
[...]
session    optional    /usr/local/lib/pam_gnome_keyring.so    auto_start

# password
[...]
I'm using xfce. I will take a look at /usr/local/pam.d/lightdm, because I'm pretty sure I made some late night mistakes in there. Thank you for the help. I have a lot to learn.
 
Well, I created the file "/home/user/.xprofile" and I included the below information within it, but I'm still receiving lines within my /var/log/messages file referencing gnome-keyring-daemon.

Code:
# ~/.xprofile

# 1. Set environment variables
export LANG=en_US.UTF-8
export GTK_IM_MODULE=xim

# 2. Start the gnome-keyring-daemon and export the necessary environment variables
export $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)

# 3. Configure SSH Agent for GNOME Keyring
# Ensures SSH keys are loaded automatically in GNOME
if [ -z "$SSH_AUTH_SOCK" ]; then
    eval $(ssh-agent -s)
fi

# 4. Set path for user-specific binaries
export PATH=$PATH:$HOME/bin

# 5. Run a command in the background
feh --bg-scale /path/to/wallpaper.jpg &

And below are the error messages I found within my /var/log/messages file
Code:
Feb 28 22:00:31 Asus gnome-keyring-daemon[3592]: couldn't access control socket: /var/run/user/1001/keyring/control: No such file or directory
Feb 28 22:00:31 Asus gnome-keyring-daemon[3592]: discover_other_daemon: 0
Feb 28 22:00:35 Asus gnome-keyring-daemon[3622]: discover_other_daemon: 0

Well, at least I have one less line in my message file referencing gnome-keyring-daemon, so maybe I'm on the right track. Is there a way to add a five or ten second delay to the .xprofile file?
 
As you have Xfce installed, you should use the AccountsService DBus service.

1. touch $(id -un)

Your new file should look like this:

Code:
[User]
Language=en_US.UTF-8
Session=xfce
XSession=xfce
SystemAccount=false

Value of Session and XSession is .desktop file available in /usr/local/share/xsessions/.

2. Put this file in /var/db/AccountsService/users/ directory

3. Download xprofile from x11/gnome/shell
Code:
fetch https://cgit.freebsd.org/ports/plain/x11/gnome-shell/files/xprofile.in

4. Replace %%PREFIX%% by /usr/local
Code:
 sed -e 's|%%PREFIX%%|/usr/local|g' xprofile.in > ~/.xprofile
chmod u+x ~/.xprofile

5. Uncomment lines related to XDG_RUNTIME_DIR variable (at the beginning, export included).

6. Uncomment following line
Code:
[...]

#eval $(gnome-keyring-daemon --start --components=pkc11,secrets,ssh)
[...]

7. Make sure you are installed devel/xdg-user-dirs pkg install xdg-user-dirs

8. Add other environment variables (especially GTK_IM_MODULE).

9. Reboot, and launch xfce4-taskmanager in order to ensure the gnome-keyring daemon is running.

With Xfce, feh is not required. gnome-keyring daemon is not required for the Xfce desktop too.

If you intend to unlock your SSH key, you should install a polkit agent. Unfortunately Xfce does not provide such client, try x11/budgie, x11/gnome-flashback or x11/gnome-shell.
 
In your .xprofile, LANG variable is not needed, locale is defined in your AccountsService profile.
Thank you very much for the very detailed and precise information. This now makes sense to me, and I will work on it this evening, or possibly tomorrow. I have spent so much time on this particular problem without much success, so I very much appreciate your assistance.

Also, when I checked my /var/log/messages file this morning, I found only one error message relating to the gnome-keying-daemon. Please see below.

Code:
gnome-keyring-daemon[3622]: asked to register item /org/freedesktop/secrets/collection/name/1, but it's already registered

Strangely the above error doesn't seem to be effecting the functionality of saved passwords, and this morning Chromium started remembering my login passwords for different websites, when before it could not do so. Also, I'm pretty certain that my AccountsService DBus service file looks very similar to what you describe above, and I know that I have lines in my lightdm file representing gnome-keying-daemon, but I will have to look at these things later.



Maybe I'm finally close to solving this problem.
 
9. Reboot, and launch xfce4-taskmanager in order to ensure the gnome-keyring daemon is running.
Below is a screen capture of what is displayed in Task Manager, following the above modifications.
gnome-keyring-daemon-start_Task_Manager.jpg



Also, below are the only two remaining errors related to gnome-keyring-daemon within my /var/log/messages file. It appears that gnome-keyring-daemon--start is listed more than once, is this normal?
Code:
Mar  2 19:22:34 Asus gnome-keyring-daemon[3271]: discover_other_daemon: 0
Mar  2 19:22:38 Asus gnome-keyring-daemon[3298]: discover_other_daemon: 0

So, I'm guessing that I must have the gnome-keyring-daemon being launched from two different configuration files within my system, but not sure where to look? But it seems I'm finally getting close to finally solving this.
 
Back
Top