#!/sbin/svc
# 
#  Copyright: ©2015, Güralp Systems Ltd.
#  Author: Laurence Withers <lwithers@guralp.com>
#  License: GPLv3
#
# PTP hardware clock (PHC) to system clock. This component is responsible for
# synchronising the Linux system clock from the PTP hardware clock by way of an
# ntpd shared memory segment.
#

MYLISTING="Precision time protocol: Linux system clock component"
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_orig /usr/sbin/phc2sys \
		-s /dev/ptp0 -E ntpshm -w -M 1 -l 5
}

stop() {
        kill_pid
}
