From bd95f01f4190a71cf6b8a8c27927419fe6e3267a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 4 Oct 2009 15:03:32 +0200 Subject: [PATCH] ntp: fix deps, add cron script to restart ntpd if necessary. Bump revision. --HG-- extra : convert_revision : 60243522b1e09709725cf12e8a9d641f712b84b2 --- templates/ntp/files/ntpd.cron-hourly | 12 ++++++++++++ templates/ntp/template | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 templates/ntp/files/ntpd.cron-hourly diff --git a/templates/ntp/files/ntpd.cron-hourly b/templates/ntp/files/ntpd.cron-hourly new file mode 100644 index 00000000000..ca0f46bbb2a --- /dev/null +++ b/templates/ntp/files/ntpd.cron-hourly @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Restarts ntpd if no connected peers are found. +# +ntpq_cmd=/usr/bin/ntpq +ntpd_initd=/etc/init.d/ntpd + +if [ ! -x $ntpq_cmd -o ! -x $ntpd_initd ]; then + exit 0 +fi + +$ntpq_cmd -np | grep '^\*' >/dev/null || (/etc/init.d/ntpd restart) diff --git a/templates/ntp/template b/templates/ntp/template index 7f47e50288c..755c1ef7ff7 100644 --- a/templates/ntp/template +++ b/templates/ntp/template @@ -1,6 +1,7 @@ # Template file for 'ntp' pkgname=ntp version=4.2.4p7 +revision=1 distfiles="http://archive.ntp.org/ntp4/$pkgname-$version.tar.gz" build_style=gnu_configure configure_args="--enable-linuxcaps --enable-getifaddrs=glibc @@ -20,19 +21,21 @@ conf_files="/etc/ntp.conf" openrc_services="ntpd default" Add_dependency full glibc +Add_dependency full readline Add_dependency full openssl Add_dependency full libcap -Add_dependency run ncurses-libs post_install() { install -d ${DESTDIR}/var/chroot/ntpd install -d ${DESTDIR}/etc/init.d ${DESTDIR}/etc/conf.d - install -d ${DESTDIR}/usr/share/ntp + install -d ${DESTDIR}/usr/share/ntp ${DESTDIR}/etc/cron.hourly install -d ${DESTDIR}/usr/share/doc/ntp install -m 644 ${FILESDIR}/ntpd.confd ${DESTDIR}/etc/conf.d/ntpd install -m 755 ${FILESDIR}/ntpd.rc ${DESTDIR}/etc/init.d/ntpd install -m 644 ${FILESDIR}/ntp.conf ${DESTDIR}/etc/ntp.conf + install -m 744 ${FILESDIR}/ntpd.cron-hourly \ + ${DESTDIR}/etc/cron.hourly/ntpd_recheck cp -a ${wrksrc}/html ${DESTDIR}/usr/share/doc/ntp cp -a ${wrksrc}/conf ${DESTDIR}/usr/share/ntp }