Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
On Wed, Feb 22, 2017 at 13:44:43 +, Lange Norbert wrote: > Hello, > > ptp4l can find the fitting ptp device (without eth tool), this doesnt seem to > be a problem. You are the second person stating this today, but I still think it is a misunderstanding regarding the network interface (like eth0) and the ptp device (/dev/ptpX). > The only time where you don`t have to specify a ethernet device might > be if you have only one (cant test this now). I can attest that it > will complain if you have a single one that would be PTP capable, but > have multiple others as well. It will always complain. Both according to the documentation and according to my own setup (one ethernet interface -> still need to specify the ethernet interface). Regards, Tino
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
Hello, ptp4l can find the fitting ptp device (without eth tool), this doesnt seem to be a problem. The only time where you don`t have to specify a ethernet device might be if you have only one (cant test this now). I can attest that it will complain if you have a single one that would be PTP capable, but have multiple others as well. Kind regards, Norbert >-Original Message- >From: Tino Mettler [mailto:tino.mett...@tikei.de] >Sent: Mittwoch, 22. Februar 2017 14:32 >To: Felipe Sateler; 855...@bugs.debian.org >Cc: Lange Norbert >Subject: classified SPAM:Re: Bug#855834: linuxptp: default startup argument >"-i >eth0" should be removed > >EXTERNAL EMAIL, please exercise caution > > >On Wed, Feb 22, 2017 at 09:51:25 -0300, Felipe Sateler wrote: > >[...] > >> The readme suggests ptp4l can detect appropiate devices by itself. If >> that is true, then there is no problem to be solved :). > >Hi, > >do you mean this? > >- > If the ethtool ioctl is available, then the ptp4l program will use > it in order to discover the proper PHC device. >- > >This means that ptp4l can find the proper PHC device (/dev/ptpX) that >belongs to a certain ethernet interface (like eth0). Before that, the >user had to specify both the ethernet interface (-i) and the PHC device >(-p) to use. > >The ethernet interface still has to be specified either on the command >line (-i option) or in the config file. > >From the manual page: > > > -i interface > Specify a PTP port, it may be used multiple times. At > least one port must be specified by this option or in > the configuration file. > > > >> >> If that is not true, I suggest the following: >> >> 1. Convert ptp4l into a template unit, ptp4l@.service >> 2. Change the device to be the instance: >> ExecStart=ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %i >> 3. Do not enable the unit. >> 4. Add a udev rule that starts the (properly instanced) service when >> it is detected. >> >> You can see the ifupdown package for a similar approach: there is >> ifup@.service, a udev rule, and a helper program (ifupdown-hotplug) >> that determines if an instance should be started for the given device. > >Thanks. I don't fully understand 4. What exactly should be detected, >and how? > >> While I looked at the service files, I noticed you order them after >> chrony, ntpdate and other time services. Systemd defines a standard >> place for that, so you can replace all those alternatives with >> `time-sync.target`. > >Thanks for the suggestions. Currently, I just look how Fedora sets up >the services and do the same, so I'm always open for suggestions how to >improve them. > >Regards, >Tino # This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system. Thank You. #
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
On Wed, Feb 22, 2017 at 10:31 AM, Tino Mettlerwrote: > On Wed, Feb 22, 2017 at 09:51:25 -0300, Felipe Sateler wrote: > > [...] > >> The readme suggests ptp4l can detect appropiate devices by itself. If >> that is true, then there is no problem to be solved :). > > Hi, > > do you mean this? > > - >If the ethtool ioctl is available, then the ptp4l program will use >it in order to discover the proper PHC device. > - Yes, that's what I was reading. > > This means that ptp4l can find the proper PHC device (/dev/ptpX) that > belongs to a certain ethernet interface (like eth0). Before that, the > user had to specify both the ethernet interface (-i) and the PHC device > (-p) to use. > > The ethernet interface still has to be specified either on the command > line (-i option) or in the config file. > > From the manual page: > > >-i interface > Specify a PTP port, it may be used multiple times. At > least one port must be specified by this option or in > the configuration file. > OK. I don't have any clue about linuxptp, so I'm going by what I read. > > >> >> If that is not true, I suggest the following: >> >> 1. Convert ptp4l into a template unit, ptp4l@.service >> 2. Change the device to be the instance: >> ExecStart=ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %i >> 3. Do not enable the unit. >> 4. Add a udev rule that starts the (properly instanced) service when >> it is detected. >> >> You can see the ifupdown package for a similar approach: there is >> ifup@.service, a udev rule, and a helper program (ifupdown-hotplug) >> that determines if an instance should be started for the given device. > > Thanks. I don't fully understand 4. What exactly should be detected, > and how? A network card. A rule like the following: SUBSYSTEM=="net", ACTION=="add|remove", RUN+="ptp-hotplug " Will run the program /lib/udev/ptp-hotplug. In that program you should be able to use the INTERFACE environment variable to then start the appropriate service: if [ -d /run/systemd/system ] ; then systemctl --no-block start \ $(systemd-escape --template linuxptp@.service $INTERFACE) systemctl --no-block start \ $(systemd-escape --template phc2sys@.service $INTERFACE) fi > >> While I looked at the service files, I noticed you order them after >> chrony, ntpdate and other time services. Systemd defines a standard >> place for that, so you can replace all those alternatives with >> `time-sync.target`. > > Thanks for the suggestions. Currently, I just look how Fedora sets up > the services and do the same, so I'm always open for suggestions how to > improve them. Great. Hopefully the service files eventually reach upstream... -- Saludos, Felipe Sateler
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
On Wed, Feb 22, 2017 at 09:51:25 -0300, Felipe Sateler wrote: [...] > The readme suggests ptp4l can detect appropiate devices by itself. If > that is true, then there is no problem to be solved :). Hi, do you mean this? - If the ethtool ioctl is available, then the ptp4l program will use it in order to discover the proper PHC device. - This means that ptp4l can find the proper PHC device (/dev/ptpX) that belongs to a certain ethernet interface (like eth0). Before that, the user had to specify both the ethernet interface (-i) and the PHC device (-p) to use. The ethernet interface still has to be specified either on the command line (-i option) or in the config file. >From the manual page: -i interface Specify a PTP port, it may be used multiple times. At least one port must be specified by this option or in the configuration file. > > If that is not true, I suggest the following: > > 1. Convert ptp4l into a template unit, ptp4l@.service > 2. Change the device to be the instance: > ExecStart=ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %i > 3. Do not enable the unit. > 4. Add a udev rule that starts the (properly instanced) service when > it is detected. > > You can see the ifupdown package for a similar approach: there is > ifup@.service, a udev rule, and a helper program (ifupdown-hotplug) > that determines if an instance should be started for the given device. Thanks. I don't fully understand 4. What exactly should be detected, and how? > While I looked at the service files, I noticed you order them after > chrony, ntpdate and other time services. Systemd defines a standard > place for that, so you can replace all those alternatives with > `time-sync.target`. Thanks for the suggestions. Currently, I just look how Fedora sets up the services and do the same, so I'm always open for suggestions how to improve them. Regards, Tino
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
Hi On Wed, Feb 22, 2017 at 7:36 AM, Tino Mettlerwrote: > On Wed, Feb 22, 2017 at 10:59:08 +0100, Norbert Lange wrote: > > [...] > >> I would recommend removing the argument, and add a section for the device in >> the >> configuration file. can be a placeholder like [eth0], I would not know >> of a good default name that would fit most systems. > > Hi, > > thanks for the comments. If I got this right, there won't be a default > name that would fit most systems as of Stretch and later. That is correct. > > A userfriedly approach would be to look for a device with PTP support > and use this, or supply a debconf request with devices that can be > used. I'll try to incorporate this. My debconf foo is limited. though, > so this might take a while. The readme suggests ptp4l can detect appropiate devices by itself. If that is true, then there is no problem to be solved :). If that is not true, I suggest the following: 1. Convert ptp4l into a template unit, ptp4l@.service 2. Change the device to be the instance: ExecStart=ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %i 3. Do not enable the unit. 4. Add a udev rule that starts the (properly instanced) service when it is detected. You can see the ifupdown package for a similar approach: there is ifup@.service, a udev rule, and a helper program (ifupdown-hotplug) that determines if an instance should be started for the given device. While I looked at the service files, I noticed you order them after chrony, ntpdate and other time services. Systemd defines a standard place for that, so you can replace all those alternatives with `time-sync.target`. -- Saludos, Felipe Sateler
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
On Wed, Feb 22, 2017 at 10:59:08 +0100, Norbert Lange wrote: [...] > I would recommend removing the argument, and add a section for the device in > the > configuration file. can be a placeholder like [eth0], I would not know > of a good default name that would fit most systems. Hi, thanks for the comments. If I got this right, there won't be a default name that would fit most systems as of Stretch and later. A userfriedly approach would be to look for a device with PTP support and use this, or supply a debconf request with devices that can be used. I'll try to incorporate this. My debconf foo is limited. though, so this might take a while. Regards, Tino
Bug#855834: linuxptp: default startup argument "-i eth0" should be removed
Package: linuxptp Version: 1.8-1 Severity: normal Dear Maintainer, a default installation of debian stretch will not use eth0 as ethernet device name anymore, also see [1]. using this as commandline argument when starting this service is troublesome, as it can`t be undone. The documention claims you can use an empty port section, to override the but I am not sure how this should be done, as that will just result in an error. I had to edit the systemd unit file to get the service starting. I would recommend removing the argument, and add a section for the device in the configuration file. can be a placeholder like [eth0], I would not know of a good default name that would fit most systems. Kind regards, Norbert Lange [1] https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.9.0-1-rt-amd64 (SMP w/4 CPU cores; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) Versions of packages linuxptp depends on: ii init-system-helpers 1.47 ii libc62.24-9 linuxptp recommends no packages. linuxptp suggests no packages. -- no debconf information