Bug 1479834 - Multiple ptp4l use same /var/run/ptp4l
Multiple ptp4l use same /var/run/ptp4l
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: linuxptp (Show other bugs)
7.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Lichvar
Qiao Zhao
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-09 09:59 EDT by Beat Rubischon
Modified: 2017-10-12 03:27 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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

linuxptp-1.4-3.20140718gitbdb6a3.el7.x86_64
linuxptp-1.7.1.fc25.x86_64
linuxptp-1.8-3.el7.x86_64

How reproducible:

always

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

https://www.mail-archive.com/linuxptp-devel@lists.sourceforge.net/msg02103.html

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