Bug 1466311

Summary: Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
Product: Red Hat Enterprise Linux 7 Reporter: SHAURYA <sshaurya>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED CURRENTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: msekleta, systemd-maint-list
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-31 16:16:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Ansible config files none

Description SHAURYA 2017-06-29 12:16:20 UTC
Created attachment 1292858 [details]
Ansible config files

Description of problem:

When trying to reboot sshd.socket we get an error:
Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.
Socket does not reboot.
However, successive stop-start commands are executed without errors.

Version-Release number of selected component (if applicable):

systemd-219-30.el7_3.6.x86_64                               
systemd-libs-219-30.el7_3.6.x86_64                         
systemd-sysv-219-30.el7_3.6.x86_64                         


How reproducible:

Always

Steps to Reproduce:

systemctl restart sshd.socket
Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.

Actual results:

Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.

Expected results:

It should restart without any issues.

Additional info:

This issue was identified when ansible was used to restart the sshd.socket service. But this issue is manually encountered as well.

Comment 2 SHAURYA 2017-06-29 12:20:48 UTC
Also this default systemd config contributes to the issue.

egrep -i 'conflicts|wants|partof' /usr/lib/systemd/system/ssh*
/usr/lib/systemd/system/sshd-keygen.service:PartOf=sshd.service sshd.socket
/usr/lib/systemd/system/sshd.service:Wants=sshd-keygen.service
/usr/lib/systemd/system/sshd@.service:Wants=sshd-keygen.service
/usr/lib/systemd/system/sshd.socket:Conflicts=sshd.service

Comment 3 Michal Sekletar 2017-07-03 09:49:17 UTC
I was able to reproduce the issue on RHEL-7.3 GA with just simple ad-hoc command, i.e. no need for the entire role.

ansible -i <IP>, -m systemd -a 'name=sshd.socket state=restarted' all

Then I've tried with latest RHEL-7.3 z-stream and I could not reproduce the problem anymore.

This issue is fixed by,

https://errata.devel.redhat.com/advisory/28248

Comment 5 Jakub Jelen 2017-07-03 11:00:33 UTC
SHAURYA: The link to the build from Errata:

https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=552571

Michal, how is this supposed to be in OpenSSH when you fixed it in systemd? Can you clarify what that you meant?