ntp update and clean-up of all rc.conf files, networkmanager clean-up changes corrected, there is no rc.conf....

This commit is contained in:
abveritas 2012-12-10 18:10:38 +00:00
parent ca563a996e
commit 001707bed6
9 changed files with 49 additions and 138 deletions

View File

@ -17,16 +17,4 @@ if [ -e /sys/fs/cgroup/systemd ]; then
timedate1 false false
;;
esac
else
if [ -e "/etc/rc.d/ntpd" ]; then
case "$2" in
up)
rc.d start ntpd
;;
down)
rc.d stop ntpd
;;
esac
fi
fi
fi

View File

@ -6,14 +6,14 @@
pkgname=networkmanager-dispatcher-ntpd
pkgver=1.0
pkgrel=4
pkgrel=5
pkgdesc="Dispatcher script for ntpd."
arch=(any)
license=('BSD')
url="http://www.gnome.org/projects/NetworkManager"
depends=('networkmanager' 'ntp')
source=("10-ntpd")
md5sums=('340dd6683fcb30aa0b4c64a26d3bc48a')
md5sums=('c5c3059c50498d6bb148444b8cf7c73d')
package() {
install -Dm700 "${srcdir}/10-ntpd" "${pkgdir}/etc/NetworkManager/dispatcher.d/10-ntpd"

View File

@ -1,39 +1,35 @@
#
# Platform Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# maintainer abveritas[at]chakra-project[dot]org>
pkgname=ntp
pkgver=4.2.6.p4
_realver=4.2.6p4
pkgrel=4
pkgver=4.2.6.p5
_realver=4.2.6p5
pkgrel=1
pkgdesc="NTP (Network Time Protocol) tries to keep servers in sync"
arch=('i686' 'x86_64')
arch=('x86_64')
license=('custom')
url="http://www.ntp.org/"
depends=('openssl' 'readline' 'libcap')
makedepends=('perl-html-parser')
backup=('etc/ntp.conf' 'etc/conf.d/ntpd.conf')
install=install
source=("http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${_realver}.tar.gz"
ntp.conf
ntpd.conf
ntpd
ntpdate
ntpd.service)
md5sums=('1447121a07b49361677ffda4f6e29527'
'302c19233dc599328f0faefcce45f109'
'58997d6cf4846d80e35a01b855376a33'
'1a487594387e87039169e200f74a8346'
'ab55ac8d8d7d0eefa3c3bec2ec98a1f4'
'866dcdb71cf27a9a9ec8d70fabb83839')
source=("http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${_realver}.tar.gz"
'ntp.conf'
'ntpd.conf'
'ntpd.service')
md5sums=('00df80a84ec9528fcfb09498075525bc'
'ac884ad959850731d8f27667681bbdf8'
'41d077a48d06e66678b52abbc56af142'
'06ae4a88dd7b9e0bc9679aebf2241167')
build() {
cd "${srcdir}/${pkgname}-${_realver}"
./configure --prefix=/usr \
--mandir=/usr/share/man \
--enable-linux-caps
--enable-linuxcaps
make
}
@ -43,19 +39,18 @@ package() {
make DESTDIR="${pkgdir}" install
rmdir "${pkgdir}"/usr/{lib,sbin}
install -Dm755 ../ntpd "${pkgdir}"/etc/rc.d/ntpd
install -Dm755 ../ntpdate "${pkgdir}"/etc/rc.d/ntpdate
install -d -o 87 "${pkgdir}/var/lib/ntp"
install -Dm644 ../ntp.conf "${pkgdir}"/etc/ntp.conf
install -Dm644 ../ntpd.conf "${pkgdir}"/etc/conf.d/ntpd.conf
install -Dm644 ../ntpd.service "${pkgdir}"/usr/lib/systemd/system/ntpd.service
install -Dm644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
cd html
../scripts/html2man
install -d "${pkgdir}"/usr/share/man
mv man/man* "${pkgdir}"/usr/share/man
mv "${pkgdir}/usr/share/man/man8/ntpd.8" "${pkgdir}/usr/share/man/man8/ntp-ntpd.8" # we should ditch openntpd
cd ..
install -d "${pkgdir}/var/lib/ntp"
install -Dm644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -dm755 "$pkgdir/usr/lib/systemd/ntp-units.d"
echo "ntpd.service" > "$pkgdir/usr/lib/systemd/ntp-units.d/$pkgname.list"
}

View File

@ -1,10 +1,20 @@
post_install() {
getent group ntp &>/dev/null || groupadd -g 87 ntp >/dev/null
getent passwd ntp &>/dev/null || useradd -u 87 -g ntp -d /var/lib/ntp -c 'Network Time Protocol' -s /bin/false ntp >/dev/null
true
}
post_upgrade() {
if [[ $(vercmp $2 4.2.6.p3) -le 0 ]]; then
cat <<EOF
==> The file /etc/conf.d/ntp-client.conf has been renamed /etc/conf.d/ntpd.conf
==> If you made changes to the former, please update the latter.
EOF
if [[ $(vercmp $2 4.2.6.p4-4) -le 0 ]]; then
post_install
fi
if [[ $(vercmp $2 4.2.6.p5-5) -le 0 ]]; then
chown -R ntp /var/lib/ntp
fi
}
post_remove() {
getent passwd ntp &>/dev/null && userdel ntp >/dev/null
getent group ntp &>/dev/null && groupdel ntp >/dev/null
true
}

View File

@ -11,12 +11,12 @@ server 1.pool.ntp.org
server 2.pool.ntp.org
# Only allow read-only access from localhost
restrict default nomodify nopeer
restrict default noquery nopeer
restrict 127.0.0.1
restrict ::1
# Location of drift and log files
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
# NOTE: If you run dhcpcd and have lines like 'restrict' and 'fudge' appearing
# here, be sure to add '-Y -N' to the dhcpcd_ethX variables in /etc/conf.d/net

View File

@ -1,52 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/ntpd.conf
PIDFILE="/var/run/ntpd/ntpd.pid"
PID=$(cat $PIDFILE 2> /dev/null)
case "$1" in
start)
stat_busy "Starting NTP Daemon"
[ ! -d /var/run/ntpd ] && install -d /var/run/ntpd &>/dev/null
if [ -z "$PID" ]; then
/usr/bin/ntpd $NTPD_ARGS -p /var/run/ntpd/ntpd.pid &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
add_daemon ntpd
stat_done
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping NTP Daemon"
if [ -n "$PID" ]; then
kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm $PIDFILE &>/dev/null
rm_daemon ntpd
stat_done
fi
else
stat_fail
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View File

@ -1,5 +1,5 @@
# client options for "ntpd -q" - ntpdate equivalent
NTP_CLIENT_OPTION="-g"
NTP_CLIENT_OPTION="-g -u ntp"
# arguments passed to ntpd when started
NTPD_ARGS="-g"
NTPD_ARGS="-g -u ntp"

View File

@ -1,12 +1,13 @@
[Unit]
Description=Network Time Service
After=network.target
After=network.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
EnvironmentFile=/etc/conf.d/ntpd.conf
ExecStart=/usr/bin/ntpd $NTPD_ARGS -p /run/ntpd.pid
PrivateTmp=true
ExecStart=/usr/bin/ntpd -g -u ntp:ntp
ControlGroup=cpu:/
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -1,31 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/ntpd.conf
case "$1" in
start)
stat_busy "Starting NTP Client"
/usr/bin/ntpd -q $NTP_CLIENT_OPTION &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
add_daemon ntpdate
stat_done
fi
;;
stop)
stat_busy "Stopping NTP Client"
rm_daemon ntpdate
stat_done
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac