Package: linuxptp
Version: 3.1-2.1
Severity: normal
Tags: patch

Dear Maintainer,

* What led up to the situation?

I am configuring PTP on BeagleBone black with Debian 11. It works fine if 
timemaster.service is manually started.

-----
    root@BeagleBone:~# systemctl status timemaster
    * timemaster.service - Synchronize system clock to NTP and PTP time sources
    Loaded: loaded (/lib/systemd/system/timemaster.service; enabled; vendor 
preset: enabled)
    Active: active (running) since Mon 2025-07-07 07:04:26 UTC; 1 day 4h ago
    Docs: man:timemaster
    Main PID: 1202 (timemaster)
    Tasks: 4 (limit: 1024)
    Memory: 1.0M
    CPU: 3min 4.852s
    CGroup: /system.slice/timemaster.service
    |-1202 /usr/sbin/timemaster -m -l 6 -f /etc/linuxptp/timemaster.conf
    |-1203 /usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    |-1577 /usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -H -i eth0
    `-1578 /usr/sbin/phc2sys -l 5 -a -r -R 1.00 -z 
/var/run/timemaster/ptp4l.0.socket -t [0:eth0] -n 0 -E ntpshm -M 0

    Jul 08 11:12:04 BeagleBone ptp4l[1577]: [102971.583] [0:eth0] selected 
local clock 3408e1.fffe.cbd9e4 as best master
-----

syslog:
-----
    Jul 8 11:36:54 BeagleBone systemd[1]: Started Synchronize system clock to 
NTP and PTP time sources.
    Jul 8 11:36:54 BeagleBone timemaster[3592]: timemaster[104461.569]: process 
3593 started: /usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    Jul 8 11:36:54 BeagleBone timemaster: [104461.569] process 3593 started: 
/usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    Jul 8 11:36:54 BeagleBone timemaster[3592]: timemaster[104461.597]: process 
3594 started: /usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -H -i 
eth0
    Jul 8 11:36:54 BeagleBone timemaster: [104461.597] process 3594 started: 
/usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -H -i eth0
    Jul 8 11:36:54 BeagleBone timemaster[3592]: timemaster[104461.613]: process 
3595 started: /usr/sbin/phc2sys -l 5 -a -r -R 1.00 -z 
/var/run/timemaster/ptp4l.0.socket -t [0:eth0] -n 0 -E ntpshm -M 0
    Jul 8 11:36:54 BeagleBone timemaster: [104461.613] process 3595 started: 
/usr/sbin/phc2sys -l 5 -a -r -R 1.00 -z /var/run/timemaster/ptp4l.0.socket -t 
[0:eth0] -n 0 -E ntpshm -M 0
    Jul 8 11:36:54 BeagleBone ptp4l: [104461.649] [0:eth0] port 1: INITIALIZING 
to LISTENING on INIT_COMPLETE
    Jul 8 11:36:54 BeagleBone ptp4l: [104461.654] [0:eth0] port 0: INITIALIZING 
to LISTENING on INIT_COMPLETE
    Jul 8 11:36:54 BeagleBone chronyd[3593]: chronyd version 4.0 starting 
(+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH 
+IPV6 -DEBUG)
    Jul 8 11:36:54 BeagleBone chronyd[3593]: Frequency 54.016 +/- 0.244 ppm 
read from /var/lib/chrony/chrony.drift
    Jul 8 11:36:54 BeagleBone chronyd[3593]: Using right/UTC timezone to obtain 
leap second data
    Jul 8 11:36:55 BeagleBone phc2sys: [104462.635] [0:eth0] Waiting for 
ptp4l...
-----

However, phc2sys is not started at boot.

-----
    root@BeagleBone:~# systemctl status timemaster
    ● timemaster.service - Synchronize system clock to NTP and PTP time sources
    Loaded: loaded (/lib/systemd/system/timemaster.service; enabled; vendor 
preset: enabled)
    Active: active (running) since Tue 2025-07-08 11:43:39 UTC; 3min 45s ago
    Docs: man:timemaster
    Main PID: 562 (timemaster)
    Tasks: 3 (limit: 1024)
    Memory: 2.7M
    CPU: 438ms
    CGroup: /system.slice/timemaster.service
    ├─562 /usr/sbin/timemaster -m -l 6 -f /etc/linuxptp/timemaster.conf
    ├─568 /usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    └─569 /usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -S -i eth0
-----

syslog:
-----
    Jul 8 11:43:39 BeagleBone timemaster[562]: timemaster[35.984]: process 568 
started: /usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    Jul 8 11:43:39 BeagleBone timemaster: [35.984] process 568 started: 
/usr/sbin/chronyd -n -f /var/run/timemaster/chrony.conf
    Jul 8 11:43:39 BeagleBone timemaster[562]: timemaster[36.032]: process 569 
started: /usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -S -i eth0
    Jul 8 11:43:39 BeagleBone timemaster: [36.032] process 569 started: 
/usr/sbin/ptp4l -l 5 -f /var/run/timemaster/ptp4l.0.conf -S -i eth0
-----

Any error or some suspected message is not found. It looks like timemaster does 
not start phc2sys.


* What exactly did you do that was effective?

There is no message but the issue seems to be started timemaster starts before 
eth0 is startup.
So, I am not sure this issue happes on other platform but at least happens on 
BeagleBone Black every time.
The issue is prevented if timemaster.service is changed like this.

-----
[Unit]
Description=Synchronize system clock to NTP and PTP time sources
Documentation=man:timemaster
After=network-online.target
Wants=network-online.target
Conflicts=chronyd.service ntpd.service phc2sys.service ptp4l.service

[Service]
Type=simple
ExecStart=/usr/sbin/timemaster -m -l 6 -f /etc/linuxptp/timemaster.conf

[Install]
WantedBy=multi-user.target
-----

* What was the outcome of this action?

I confirmed reboot 6 times and the fix is works good.


-- System Information:
Debian Release: 11.11
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 
'oldstable')
Architecture: armhf (armv7l)

Kernel: Linux 5.10.168-ti-r79 (SMP w/1 CPU thread; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to ja_JP.UTF8), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages linuxptp depends on:
ii  libc6  2.31-13+deb11u11

linuxptp recommends no packages.

linuxptp suggests no packages.

-- Configuration Files:
/etc/linuxptp/ptp4l.conf [Errno 2] そのようなファイルやディレクトリはありません: 
'/etc/linuxptp/ptp4l.conf'
/etc/linuxptp/timemaster.conf changed:
[ptp_domain 0]
interfaces eth0
delay 10e-6
[timemaster]
ntp_program chronyd
[chrony.conf]
include /etc/chrony.conf
[ntp.conf]
includefile /etc/ntp.conf
[ptp4l.conf]
[chronyd]
path /usr/sbin/chronyd
[phc2sys]
path /usr/sbin/phc2sys
[ptp4l]
path /usr/sbin/ptp4l


-- no debconf information

Reply via email to