From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-misc/ptpd/files/ptpd2.confd | 4 +++ net-misc/ptpd/files/ptpd2.rc | 56 +++++++++++++++++++++++++++++++++++++++ net-misc/ptpd/files/ptpd2.service | 11 ++++++++ 3 files changed, 71 insertions(+) create mode 100644 net-misc/ptpd/files/ptpd2.confd create mode 100644 net-misc/ptpd/files/ptpd2.rc create mode 100644 net-misc/ptpd/files/ptpd2.service (limited to 'net-misc/ptpd/files') diff --git a/net-misc/ptpd/files/ptpd2.confd b/net-misc/ptpd/files/ptpd2.confd new file mode 100644 index 000000000000..22fe2d49285f --- /dev/null +++ b/net-misc/ptpd/files/ptpd2.confd @@ -0,0 +1,4 @@ +# /etc/conf.d/ptpd2 + +# Options to pass to ptpd2 +PTPD_OPTS="" diff --git a/net-misc/ptpd/files/ptpd2.rc b/net-misc/ptpd/files/ptpd2.rc new file mode 100644 index 000000000000..bf8e14332298 --- /dev/null +++ b/net-misc/ptpd/files/ptpd2.rc @@ -0,0 +1,56 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PTPD_CONFIGFILE=${PTPD_CONFIGFILE:-/etc/${RC_SVCNAME}.conf} +PTPD_STATEFILE_DIR=${PTPD_STATEFILE_DIR:-/var/run} +PTPD_STATEFILE=${PTPD_STATEFILE:-${PTPD_STATEFILE_DIR}/${RC_SVCNAME}.status} +PTPD_PIDFILE_DIR=${PTPD_PIDFILE_DIR:-/var/run} +PTPD_PIDFILE=${PTPD_PIDFILE:-${PTPD_PIDFILE_DIR}/${RC_SVCNAME}.pid} + +extra_commands="checkconfig" +extra_started_commands="reload" +command="/usr/sbin/ptpd2" +command_args="--global:lock_file=$PTPD_PIDFILE --global:status_file=$PTPD_STATEFILE -c $PTPD_CONFIGFILE $PTPD_OPTS" +pidfile="${PTPD_PIDFILE}" +description="Precise Time Protocol daemon" + + +depend() { + use net dns logger +} + +checkconfig() { + ebegin "Checking ${SVCNAME} configuration" + msgout="$($command -k $command_args 2>&1)" + RETVAL=$? + + # colorize output + echo "$msgout" | while read ln; do + if [[ "$ln" == *ignored* ]]; then + ewarn "$ln" + elif [[ "$ln" != "Configuration OK" ]]; then + eerror "$ln" + fi + done + + eend $RETVAL +} + +start() { + checkconfig || return 1 + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec ${command} \ + --pidfile ${pidfile} \ + -- ${command_args} + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading ${SVCNAME} configuration" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} diff --git a/net-misc/ptpd/files/ptpd2.service b/net-misc/ptpd/files/ptpd2.service new file mode 100644 index 000000000000..35fb34fd6897 --- /dev/null +++ b/net-misc/ptpd/files/ptpd2.service @@ -0,0 +1,11 @@ +[Unit] +Description=Precise Time Protocol daemon +Documentation=man:ptpd2(8) +After=network.target + +[Service] +ExecStart=/usr/sbin/ptpd2 -C -c /etc/ptpd2.conf +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3