mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-06-09 14:44:11 +02:00
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at> Closes: https://bugs.gentoo.org/849287 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
56 lines
1.3 KiB
Text
56 lines
1.3 KiB
Text
#!/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 $?
|
|
}
|