Major infrastructure changes, part 2.
* Moved helpers, common and triggers dirs into xbps-src, where
they belong.
* Renamed the templates dir to srcpkgs, it was so redundant before.
* Make it possible to add subpkgs with no restriction in names, for
example udev now has a subpkgs called "libgudev". Previously
subpkgs were named "${sourcepkg}-${pkgname}".
* xbps-src: changed to look for template files in current directory.
That means that most arguments from the targets have been removed.
* xbps-src: added a reinstall target, to remove + install.
* xbps-src: do not overwrite binpkgs by default, skip them.
And more that I forgot because it's a mega-commit that I've been
working for some days already...
--HG--
extra : convert_revision : 0f466878584d1e6895d2a234f07ea1b2d1e61b3e
This commit is contained in:
83
srcpkgs/ntp/files/ntp.conf
Normal file
83
srcpkgs/ntp/files/ntp.conf
Normal file
@@ -0,0 +1,83 @@
|
||||
# $NetBSD: ntp.conf,v 1.9 2007/02/10 19:36:56 reed Exp $
|
||||
#
|
||||
# NetBSD default Network Time Protocol (NTP) configuration file for ntpd
|
||||
|
||||
# This file is intended to be both a usable default, and a Quick-Start
|
||||
# Guide. The directives and options listed here are not at all complete.
|
||||
# A great deal of additional documentation, including links to FAQS and
|
||||
# other guides, may be found on the official NTP web site, in particular
|
||||
#
|
||||
# http://www.ntp.org/documentation.html
|
||||
#
|
||||
|
||||
# Process ID file, so that the daemon can be signalled from scripts
|
||||
|
||||
pidfile /var/run/ntpd.pid
|
||||
|
||||
# The correction calculated by ntpd(8) for the local system clock's
|
||||
# drift is stored here.
|
||||
|
||||
driftfile /var/db/ntpd.drift
|
||||
|
||||
# Suppress the syslog(3) message for each peer synchronization change.
|
||||
|
||||
logconfig -syncstatus
|
||||
|
||||
# This will help minimize disruptions due to network congestion. Don't
|
||||
# do this if you configure only one server!
|
||||
|
||||
tos minsane 2
|
||||
|
||||
# Hereafter should be "server" or "peer" statements to configure other
|
||||
# hosts to exchange NTP packets with. Peers should be selected in such
|
||||
# a way that the network path to them is symmetric (that is, the series
|
||||
# of links and routers used to get to the peer is the same one that the
|
||||
# peer uses to get back. NTP assumes such symmetry in its network delay
|
||||
# calculation. NTP will apply an incorrect adjustment to timestamps
|
||||
# received from the peer if the path is not symmetric. This can result
|
||||
# in clock skew (your system clock being maintained consistently wrong
|
||||
# by a certain amount).
|
||||
#
|
||||
# The best way to select symmetric peers is to make sure that the
|
||||
# network path to them is as short as possible (this reduces the chance
|
||||
# that there is more than one network path between you and your peer).
|
||||
# You can measure these distances with the traceroute(8) program. The
|
||||
# best place to start looking for NTP peers for your system is within
|
||||
# your own network, or at your Internet Service Provider (ISP).
|
||||
#
|
||||
# Ideally, you should select at least three other systems to talk NTP
|
||||
# with, for an "what I tell you three times is true" effect.
|
||||
#
|
||||
|
||||
#peer an.ntp.peer.goes.here
|
||||
#server an.ntp.server.goes.here
|
||||
|
||||
# Public servers from the pool.ntp.org project. Volunteer's servers
|
||||
# are dynamically assigned to the CNAMES below via DNS round-robin.
|
||||
# The pool.ntp.org project needs more volunteers! The only criteria to
|
||||
# join are a nailed-up connection and a static IP address. For details,
|
||||
# see the web page:
|
||||
#
|
||||
# http://www.pool.ntp.org/
|
||||
#
|
||||
|
||||
# The country codes can help you find servers that are net-wise close.
|
||||
# As explained above, closer is better...
|
||||
|
||||
# Northern U.S.A
|
||||
#server ca.pool.ntp.org
|
||||
#server us.pool.ntp.org
|
||||
#server us.pool.ntp.org
|
||||
|
||||
# Northern Europe
|
||||
#server de.pool.ntp.org
|
||||
#server de.pool.ntp.org
|
||||
#server dk.pool.ntp.org
|
||||
|
||||
# Depending on the vagaries of DNS can occasionally pull in the same
|
||||
# server twice. The following CNAMES are guaranteed to be disjoint, at
|
||||
# least over some short interval.
|
||||
|
||||
server 0.pool.ntp.org
|
||||
server 1.pool.ntp.org
|
||||
server 2.pool.ntp.org
|
||||
6
srcpkgs/ntp/files/ntpd.confd
Normal file
6
srcpkgs/ntp/files/ntpd.confd
Normal file
@@ -0,0 +1,6 @@
|
||||
# Configuration file for ntp.
|
||||
#
|
||||
# Comment the following line to NOT run ntpd(8) in a chroot
|
||||
# as the ntpd user/group. NOT RECOMMENDED.
|
||||
#
|
||||
ntpd_chroot=/var/chroot/ntpd
|
||||
12
srcpkgs/ntp/files/ntpd.cron-hourly
Normal file
12
srcpkgs/ntp/files/ntpd.cron-hourly
Normal file
@@ -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)
|
||||
37
srcpkgs/ntp/files/ntpd.rc
Normal file
37
srcpkgs/ntp/files/ntpd.rc
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
|
||||
# All rights reserved. Released under the 2-clause BSD license.
|
||||
|
||||
: ${ntpd_config:=/etc/ntp.conf}
|
||||
: ${ntpd_drift:=/var/db/ntpd.drift}
|
||||
|
||||
command=/usr/bin/ntpd
|
||||
required_files=$ntpd_config
|
||||
pidfile=/var/run/ntpd.pid
|
||||
command_args="$ntpd_args -c $ntpd_config -f $ntpd_drift -p $pidfile"
|
||||
name="Network Time Protocol Daemon"
|
||||
|
||||
depend()
|
||||
{
|
||||
use dns
|
||||
need localmount
|
||||
after bootmisc ntp-client
|
||||
}
|
||||
|
||||
start_pre()
|
||||
{
|
||||
if [ -n "$ntpd_chroot" ]; then
|
||||
case "$RC_UNAME" in
|
||||
*BSD|DragonFly)
|
||||
if [ ! -c "$ntpd_chroot/dev/clockctl" ]; then
|
||||
rm -f "$ntpd_chroot/dev/clockctl"
|
||||
(cd /dev; /bin/pax -rw -pe clockctl \
|
||||
"$ntpd_chroot/dev")
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
ln -fs "$ntpd_chroot$ntpd_drift" "$ntpd_drift"
|
||||
|
||||
command_args="$command_args -u ntpd:ntpd -i $ntpd_chroot"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user