Bug 1479834 - Multiple ptp4l use same /var/run/ptp4l
Multiple ptp4l use same /var/run/ptp4l
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: linuxptp (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Lichvar
Qiao Zhao
Depends On:
Blocks: 1549614
  Show dependency treegraph
Reported: 2017-08-09 09:59 EDT by Beat Rubischon
Modified: 2018-05-17 05:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2018-05-17 05:09:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Beat Rubischon 2017-08-09 09:59:28 EDT
Description of problem:

ptp4l uses the socket /var/run/ptp4l to communicate with the management tool pmc and to deliver an up to date interface list to phc2sys. Multiple ptp4l by intention or by mistake will use the same socket.

Killing one of those ptp4l processes would remove the socket, phc2sys won't be able to synchronize any longer due to the lack of communication with ptp4l.

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

Tested on


How reproducible:


Steps to Reproduce:
1. Install linuxptp
2. Run "ptp4l -i enp0s25 -m"
3. Run "phc2sys -a -m"
4. Run "ptp4l -i enp0s25 -m"
5. Stop second instance of ptp4l

Actual results:

phc2sys will stop synchronizing time, complaining...

phc2sys[3829328.174]: uds: sendto failed: No such file or directory
phc2sys[3829328.174]: uds: sendto failed: No such file or directory
phc2sys[3829329.174]: uds: sendto failed: No such file or directory

Expected results:

phc2sys will continue synchronizing time

Additional info:

phc2sys requires bare metal system with an PTP capable NIC.

It's unclear to me if and when how we could change the current behavior. In multiple ptp4l setups the phc2sys process is usually configured manually, still we have an issue in cases where a second ptp4l was started "to check the functionality" and killed afterwards. Leaving the socket in place might be an option, but requires further testing.
Comment 2 Miroslav Lichvar 2017-08-10 07:09:27 EDT
I think one way to solve this would be to modify ptp4l to not try to remove the socket on start. If binding to the socket fails, ptp4l will work without the UDS transport, or perhaps it could be handled as a fatal error.

The question is if it would be acceptable behavior in case the socket was left there due to ptp4l terminating in an abnormal way (e.g. crash). The user would have to manually remove the socket in order to get phc2sys working. It will change the user experience.
Comment 3 Miroslav Lichvar 2017-10-12 03:27:18 EDT
FWIW, an RFC patch was posted for this on the upstream list

Comment 4 Miroslav Lichvar 2018-03-22 07:05:04 EDT
As this would change the behavior of ptp4l in case of an existing socket (from existing or crashed ptp4l instance), I think it would rather be a candidate for the next major RHEL release instead of minor release.
Comment 8 Red Hat Bugzilla Rules Engine 2018-05-17 05:09:53 EDT
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

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