Bug 1826233

Summary: ods-enforcerd.service should wait until socket is ready
Product: [Fedora] Fedora Reporter: Christian Heimes <cheimes>
Component: opendnssecAssignee: Paul Wouters <pwouters>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 32CC: abokovoy, puiterwijk, pvrabec, pwouters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: opendnssec-2.1.7-2.eln108 opendnssec-2.1.7-2.fc33 opendnssec-2.1.7-2.fc32 opendnssec-2.1.7-3.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-16 21:43:17 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:

Description Christian Heimes 2020-04-21 09:43:59 UTC
Description of problem:
ods-enforcerd.service is a forking service. The services creates and listens on the Unix socket /run/opendnssec/enforcer.sock. systemd will continue starting depending services as soon as the ods-enforcer daemon is forked off. It doesn't wait until the daemon is ready to handle requests. This is racy and cause errors.

Version-Release number of selected component (if applicable):
opendnssec-2.1.6-5.fc32

How reproducible:
sometimes (race condition)

Additional info:
The service unit should not indicate readiness until the socket is available. There are several options:

* ods-enforcerd chould use sd-notify API, but this would require several changes to the code.
* systemd could block until the socket is ready. This approach is simpler. Since ods-enforcerd removes the socket file on shutdown, an ExecStartPost hook that waits for the socket should do the trick:

    [Service]
    ExecStartPost=/bin/bash -c 'while [ ! -S /run/opendnssec/enforcer.sock ]; do sleep 1; echo "Waiting for socket"; done'
    TimeoutStartSec=20

Comment 1 Fedora Update System 2020-12-09 03:42:29 UTC
FEDORA-2020-540fe8c016 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-540fe8c016

Comment 2 Fedora Update System 2020-12-09 03:42:57 UTC
FEDORA-2020-1f39b24f23 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-1f39b24f23

Comment 3 Fedora Update System 2020-12-10 23:49:43 UTC
FEDORA-2020-1f39b24f23 has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-1f39b24f23`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-1f39b24f23

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2020-12-11 00:03:53 UTC
FEDORA-2020-540fe8c016 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-540fe8c016`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-540fe8c016

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2020-12-16 21:43:17 UTC
FEDORA-2020-f856f37388 has been pushed to the Fedora ELN stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2020-12-18 01:09:38 UTC
FEDORA-2020-540fe8c016 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2020-12-18 02:06:38 UTC
FEDORA-2020-1f39b24f23 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2020-12-19 18:24:11 UTC
FEDORA-2020-8b0b8fb26a has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.