[ptpd/el6] new files to support ptpd version 2.3.0

jondkent jondkent at fedoraproject.org
Wed Jun 11 21:14:17 UTC 2014


commit 3589a7c02fcd643d6e5622fe39b6a3013c248cef
Author: Jon Kent <jon.kent at gmail.com>
Date:   Wed Jun 11 22:13:32 2014 +0100

    new files to support ptpd version 2.3.0

 ptpd2      |   10 ++++++
 ptpd2.conf |   62 ++++++++++++++++++++++++++++++++++++++
 ptpd2.init |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 168 insertions(+), 0 deletions(-)
---
diff --git a/ptpd2 b/ptpd2
new file mode 100644
index 0000000..b792cbb
--- /dev/null
+++ b/ptpd2
@@ -0,0 +1,10 @@
+# Config file location
+PTPD_CONFIG_FILE="/etc/ptpd2.conf"
+# Lock / PID file location
+#PTPD_PID_FILE="/var/run/ptpd2.lock"
+# Status file location
+#PTPD_STATUS_FILE="/var/run/ptpd2.status"
+
+# Any extra command-line options
+PTPD_EXTRA_OPTIONS=""
+
diff --git a/ptpd2.conf b/ptpd2.conf
new file mode 100644
index 0000000..67e6db3
--- /dev/null
+++ b/ptpd2.conf
@@ -0,0 +1,62 @@
+; ==============================================================================
+; This is a recommended configuration for a PTPv2 slave
+; For a full list of options run ptpd2 -H or see the documentation and man pages
+; ==============================================================================
+
+; interface has to be specified
+ptpengine:interface=
+
+; PTP domain
+ptpengine:domain=0
+
+; available presets are slaveonly, masteronly and masterslave (full IEEE 1588 implementation)
+ptpengine:preset=slaveonly
+
+; multicast for both sync and delay requests - use hybrid for unicast delay requests
+ptpengine:ip_mode=multicast
+
+; when enabled, sniffing is used instead of sockets to send and receive packets
+ptpengine:use_libpcap=n
+
+; go into panic mode for 10 minutes instead of resetting the clock
+ptpengine:panic_mode=y
+ptpengine:panic_mode_duration=10
+
+; uncomment this to enable outlier filters
+ptpengine:sync_outlier_filter_enable=y
+ptpengine:delay_outlier_filter_enable=y
+
+; store observed drift in a file
+clock:drift_handling=file
+clock:drift_file=/var/log/ptpd2_kernelclock.drift
+
+; update online statistics every 5 seconds
+global:statistics_update_interval=5
+
+; wait 5 statistics intervals for one-way delay to stabilise
+ptpengine:calibration_delay=5
+
+; log file, event log only. if timing statistics are needed, see statistics_file
+global:log_file=/var/log/ptpd2.log
+; log file up to 5M
+global:log_file_max_size=5000
+; rotate logs up to 5 files
+global:log_file_max_files=5
+
+; status file providing an overview of ptpd's operation and statistics
+global:log_status=y
+
+; required if ip_mode is set to hybrid
+;ptpengine:log_delayreq_interval=0
+
+; uncomment this to log a timing log like in previous ptpd versions
+;global:statistics_file=/var/log/ptpd2.stats
+
+; on multi-core systems it is recommended to bind ptpd to a single core
+;global:cpuaffinity_cpucore=0
+
+; use DSCP 46 for expedited forwarding over ipv4 networks
+ptpengine:ip_dscp=46
+
+; always keep a new line in the end
+
diff --git a/ptpd2.init b/ptpd2.init
new file mode 100755
index 0000000..9cf88ec
--- /dev/null
+++ b/ptpd2.init
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# ptpd Precision Time Protocol daemon
+#
+# chkconfig:   - 30 70
+# description: ptpd implements a sub ms time coordination of LAN connected computers \
+#              implementing IEEE 1588
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+exec="/usr/bin/ptpd2"
+prog="ptpd2"
+
+if [ -e /etc/sysconfig/$prog ]; then
+	. /etc/sysconfig/$prog
+	# update ptpd2.conf file rather than add command line options to the below
+	PTPD_OPTIONS="-c $PTPD_CONFIG_FILE $PTPD_EXTRA_OPTIONS"
+fi
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    echo -n $"Starting $prog: "
+    daemon --user root $exec $PTPD_OPTIONS
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
+


More information about the scm-commits mailing list