Bug 2125576 - ssh-agent.service user unit not possible to enable
Summary: ssh-agent.service user unit not possible to enable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 36
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
Assignee: Dmitry Belyavskiy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-09 10:42 UTC by Dominik 'Rathann' Mierzejewski
Modified: 2022-11-09 08:47 UTC (History)
10 users (show)

Fixed In Version: openssh-9.0p1-6.fc38
Clone Of:
Environment:
Last Closed: 2022-11-09 08:47:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-604 0 None None None 2022-09-09 18:32:11 UTC

Description Dominik 'Rathann' Mierzejewski 2022-09-09 10:42:45 UTC
Description of problem:
ssh-agent.service user unit has no installation config settings in the [Install] section.

Version-Release number of selected component (if applicable):
openssh-clients-8.8p1-1.fc36.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. systemctl --user enable ssh-agent.service

Actual results:
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

Expected results:
No error, unit should get enabled.

Additional info:
Due to the above, the unit cannot be enabled easily in MATE session (after disabling gnome-keyring SSH component and applying https://src.fedoraproject.org/rpms/xorg-x11-xinit/pull-request/5).

Comment 1 Dmitry Belyavskiy 2022-09-09 11:04:04 UTC
Would you mind suggesting a patch?

Comment 2 Dominik 'Rathann' Mierzejewski 2022-09-09 18:24:15 UTC
I checked a few random user services and found they're all static. However, they're either triggered by a socket or dbus-activated. For example, gpg-agent-ssh.service is triggered by gpg-agent-ssh.socket,
so maybe the same should be done for ssh-agent. We would have to hard-code the socket path in that case, but then it'd work similar to gpg-agent-ssh.service, which I think is desirable.

If nobody beats me to it, I'll try to post a patch soon.

Comment 3 Anthony Rabbito 2022-09-11 14:48:29 UTC
I've been using my own (similar) set of user units just to recently learn openssh-clients includes them. Which made me happy to hear. Sadly I ran into this RHBZ when trying to actually use it. I took a stab at fixing this here https://src.fedoraproject.org/rpms/openssh/pull-request/35

Comment 4 Fedora Update System 2022-10-07 11:27:33 UTC
FEDORA-2022-fae4ff2403 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fae4ff2403

Comment 5 Fedora Update System 2022-10-07 11:30:23 UTC
FEDORA-2022-fae4ff2403 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Martin Kolman 2022-10-26 12:35:46 UTC
So looks like on the installation images this breaks SSH access to the installation environment, see bug 2136916.

Basically, if inst.sshd is passed as boot option, the Anaconda installer tries to start sshd. that used to work, but with openssh-9.0p1-6.fc38 sshd.socket is now active and already bind to the point, breaking the anaconda-sshd service. 

Not really sure how the SSH agent unit/socket changes do that, but it does happen.

Comment 7 Anthony Rabbito 2022-10-26 14:10:53 UTC
That is quite an unfortunate occurrence. Later today I will read closer into how Anaconda ssh works and hopefully use a systemd directive like "Conflicts" to avoid the ssh-socket being used during installation. Better yet, really understand how this breaks things because it shouldn't..

Comment 8 Martin Kolman 2022-11-07 13:59:52 UTC
Any updates on this ? This still blocking CI image refresh for our Web UI tests (making it more and more likely it breaks with the outdated image) as well as making any runtime installation issues hard to debug.

A speedy fix or revert of the patch causing this issues would be appreciated!

Comment 9 Jiri Konecny 2022-11-09 08:47:11 UTC
Closing as we found that the issue is not related to openssh but instead it seems it is a systemd issue. Will be handled in bug 2136916 .


Note You need to log in before you can comment on or make changes to this bug.