summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-07-24 05:44:56 +0000
committerMike Frysinger <vapier@gentoo.org>2004-07-24 05:44:56 +0000
commitf20dc8843268063b0bd14c552ca26d782b5dfef4 (patch)
treea2aabc8b42411df1f21495b56178f8b075b8e29b /net-misc/ntp/files/ntp-client.rc
parentRemoving old versions. Fixing DEPEND. (diff)
downloadhistorical-f20dc8843268063b0bd14c552ca26d782b5dfef4.tar.gz
historical-f20dc8843268063b0bd14c552ca26d782b5dfef4.tar.bz2
historical-f20dc8843268063b0bd14c552ca26d782b5dfef4.zip
allow user to set a timeout for ntp-client #58015
Diffstat (limited to 'net-misc/ntp/files/ntp-client.rc')
-rw-r--r--net-misc/ntp/files/ntp-client.rc7
1 files changed, 5 insertions, 2 deletions
diff --git a/net-misc/ntp/files/ntp-client.rc b/net-misc/ntp/files/ntp-client.rc
index b48bcd426c14..ca244e97ccc5 100644
--- a/net-misc/ntp/files/ntp-client.rc
+++ b/net-misc/ntp/files/ntp-client.rc
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.rc,v 1.6 2004/06/26 16:38:45 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.rc,v 1.7 2004/07/24 05:44:56 vapier Exp $
depend() {
before cron
@@ -27,6 +27,9 @@ start() {
checkconfig || return $?
ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
- ${NTPCLIENT_CMD} ${NTPCLIENT_OPTS} >/dev/null
+ ${NTPCLIENT_CMD} ${NTPCLIENT_OPTS} >/dev/null &
+ local pid=$!
+ (sleep ${NTPCLIENT_TIMEOUT:-30}; kill -9 ${pid} >&/dev/null) &
+ wait ${pid}
eend $? "Failed to set clock"
}