diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2002-12-27 23:47:44 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2002-12-27 23:47:44 +0000 |
commit | 429303050db74a8092ced7c1d072dc14ec9cb396 (patch) | |
tree | ab69383a7fc14e4258581a71b4b8146e8bbb84cd /net-misc/ntp/files | |
parent | Unmasked due to glsa (diff) | |
download | historical-429303050db74a8092ced7c1d072dc14ec9cb396.tar.gz historical-429303050db74a8092ced7c1d072dc14ec9cb396.tar.bz2 historical-429303050db74a8092ced7c1d072dc14ec9cb396.zip |
fix bug #897 again
Diffstat (limited to 'net-misc/ntp/files')
-rw-r--r-- | net-misc/ntp/files/digest-ntp-4.1.1b-r2 | 1 | ||||
-rw-r--r-- | net-misc/ntp/files/ntpd.confd | 15 | ||||
-rw-r--r-- | net-misc/ntp/files/ntpd.rc | 26 |
3 files changed, 32 insertions, 10 deletions
diff --git a/net-misc/ntp/files/digest-ntp-4.1.1b-r2 b/net-misc/ntp/files/digest-ntp-4.1.1b-r2 new file mode 100644 index 000000000000..dcdc2e9a8f30 --- /dev/null +++ b/net-misc/ntp/files/digest-ntp-4.1.1b-r2 @@ -0,0 +1 @@ +MD5 27382aa9c483e395662dddb2b11439e2 ntp-4.1.1b.tar.gz 2125307 diff --git a/net-misc/ntp/files/ntpd.confd b/net-misc/ntp/files/ntpd.confd new file mode 100644 index 000000000000..29b916646110 --- /dev/null +++ b/net-misc/ntp/files/ntpd.confd @@ -0,0 +1,15 @@ +# /etc/conf.d/ntpd: +# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.6 2002/12/27 23:47:44 azarah Exp $ + +# Config file for /etc/init.d/ntpd + +# The '-q' option mimics the behaviour of the 'ntpdate' program, +# which is to be retired. It causes ntpd to exit just after the +# first time the clock is set. You should add the 'iburst' +# keyword to the server statements in /etc/ntp.conf before using +# this. Also note that 'ntpd -q' will not set the time if its +# off by more than 1000 secs, so adding '-g' may be a needed if +# your time tends to be out with a few seconds. + +#NTPD_OPTS="-q -g" + diff --git a/net-misc/ntp/files/ntpd.rc b/net-misc/ntp/files/ntpd.rc index 09f3729300c3..d2a68dccd33f 100644 --- a/net-misc/ntp/files/ntpd.rc +++ b/net-misc/ntp/files/ntpd.rc @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.6 2002/12/23 17:12:48 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.7 2002/12/27 23:47:44 azarah Exp $ depend() { need net @@ -19,19 +19,25 @@ checkconfig() { start() { checkconfig || return $? - NTPDATESERVERS=`egrep '^(server|peer)[[:space:]]+' /etc/ntp.conf | awk '{print $2}'` - if [ -n "${NTPDATESERVERS}" ] ; then - ebegin "Running ntpdate" - ntpdate -b ${NTPDATESERVERS} > /dev/null - eend $? "Failed to run ntpdate" - else + NTPDATESERVERS="`egrep '^(server|peer)[[:space:]]+' /etc/ntp.conf`" + if [ -z "${NTPDATESERVERS}" ] ; then ewarn "Please set a valid server line in /etc/ntp.conf" fi - ebegin "Starting ntpd" + if [ "${NTPD_OPTS/-q}" != "${NTPD_OPTS}" ] ; then + ebegin "Starting ntpd (ntpdate)" + start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \ + --startas /usr/bin/ntpd -- -p /var/run/ntpd.pid ${NTPD_OPTS} + eend $? "Failed to start ntpd (ntpdate)" + + # clean stale pidfile + [ -f /var/run/ntpd.pid ] && rm -f /var/run/ntpd.pid + fi + + ebegin "Starting ntpd (daemon)" start-stop-daemon --start --quiet --pidfile /var/run/ntpd.pid \ - --startas /usr/bin/ntpd -- -p /var/run/ntpd.pid - eend $? "Failed to start ntpd" + --startas /usr/bin/ntpd -- -p /var/run/ntpd.pid ${NTPD_OPTS/-q} + eend $? "Failed to start ntpd (daemon)" } stop() { |