diff options
author | Thilo Bangert <bangert@gentoo.org> | 2009-10-14 08:04:19 +0000 |
---|---|---|
committer | Thilo Bangert <bangert@gentoo.org> | 2009-10-14 08:04:19 +0000 |
commit | e1be477e9f8db5cb0a7e7c01796536b058438529 (patch) | |
tree | 0ba4a55b16a4c521c7284698a27b2ea79831a0da /net-misc/openntpd/files | |
parent | Version bump to 2.08. Bug #287217 (diff) | |
download | historical-e1be477e9f8db5cb0a7e7c01796536b058438529.tar.gz historical-e1be477e9f8db5cb0a7e7c01796536b058438529.tar.bz2 historical-e1be477e9f8db5cb0a7e7c01796536b058438529.zip |
eapi=2 - fix timezone info for chrooted process (bug #226491)
Package-Manager: portage-2.2_rc42/cvs/Linux i686
Diffstat (limited to 'net-misc/openntpd/files')
-rw-r--r-- | net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2 | 7 | ||||
-rw-r--r-- | net-misc/openntpd/files/openntpd.rc-3.9_p1-r2 | 45 |
2 files changed, 52 insertions, 0 deletions
diff --git a/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2 b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2 new file mode 100644 index 000000000000..f07752752022 --- /dev/null +++ b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2 @@ -0,0 +1,7 @@ +# /etc/conf.d/ntpd: config file for openntpd's ntpd + +NTPD_HOME=/var/lib/openntpd/chroot + +# See ntpd(8) man page ... some popular options: +# -s Set the time immediately at startup +NTPD_OPTS="" diff --git a/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2 b/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2 new file mode 100644 index 000000000000..455e4e21cfd2 --- /dev/null +++ b/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2 @@ -0,0 +1,45 @@ +#!/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/openntpd/files/openntpd.rc-3.9_p1-r2,v 1.1 2009/10/14 08:04:19 bangert Exp $ + +depend() { + need net + after ntp-client + use dns logger +} + +checkconfig() { + if [ ! -f /etc/ntpd.conf ] ; then + eerror "Could not find /etc/ntpd.conf!" + return 1 + fi + + if [ -x /usr/bin/getent ] ; then + if [ "`getent passwd ntp | cut -d: -f 6`" != "${NTPD_HOME}" ] ; then + eerror "Home directory of ntp needs to be ${NTPD_HOME}" + eerror "Please run 'usermod -d ${NTPD_HOME} ntp'" + return 1 + fi + fi + + return 0 +} + +start() { + checkconfig || return $? + + #prepare chroot + mkdir -p /var/lib/openntpd/chroot/etc/ + cp /etc/localtime /var/lib/openntpd/chroot/etc + + ebegin "Starting ntpd" + start-stop-daemon --start --exec /usr/sbin/ntpd --name ntpd -- ${NTPD_OPTS} + eend $? "Failed to start ntpd" +} + +stop() { + ebegin "Stopping ntpd" + start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root + eend $? "Failed to stop openntpd" +} |