#!/sbin/svc
# 
#  Copyright: ©2015, Güralp Systems Ltd.
#  Author: Laurence Withers <lwithers@guralp.com>
#  License: GPLv3
#
# PTP driver for Linux. This is the control component for the PTP PHY that
# enables hardware timestamping/servoing. We have a wrapper script that exposes
# the lock/unlock status in various manners to the rest of the system.
#

MYLISTING="Precision time protocol: hardware client"
CFGFILE="/etc/conf.d/ptp-client.local"
CONTROL_GROUP="conf"

start() {
	# -s /dev/ptp0			source device
	# -E ntpshm			integrate with ntpshm driver
	# -w				wait for ptp4l
	# -M 1				NTP shared memory segment
	# -l 5				system log level
	daemonize /usr/sbin/ptp-client --config "${CFGFILE}" \
		--user "daemon" --group "daemon"
}

stop() {
        kill_pid
}
