ntp: use ntpd system account for daemon; add ntpdate service, convert html to man.
This commit is contained in:
parent
f38cec55a6
commit
c6de191bac
3 changed files with 31 additions and 10 deletions
|
@ -1,8 +1,12 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Network Time Service
|
Description=Network Time Service
|
||||||
|
After=network.target nss-lookup.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/ntpd -ng
|
PrivateTmp=true
|
||||||
|
ExecStart=/usr/bin/ntpd -n -g -u ntpd:ntpd
|
||||||
|
ControlGroup=cpu:/
|
||||||
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
13
srcpkgs/ntp/files/ntpdate.service
Normal file
13
srcpkgs/ntp/files/ntpdate.service
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=One-Shot Network Time Service
|
||||||
|
After=network.target nss-lookup.target
|
||||||
|
Before=ntpd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
PrivateTmp=true
|
||||||
|
ExecStart=/usr/bin/ntpd -q -g -u ntpd:ntpd
|
||||||
|
ControlGroup=cpu:/
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,9 +1,10 @@
|
||||||
# Template file for 'ntp'
|
# Template file for 'ntp'
|
||||||
pkgname=ntp
|
pkgname=ntp
|
||||||
version=4.2.6p5
|
version=4.2.6p5
|
||||||
revision=7
|
revision=8
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--enable-linuxcap"
|
configure_args="--enable-linuxcap"
|
||||||
|
hostmakedepends="perl-HTML-Parser"
|
||||||
makedepends="readline-devel openssl-devel libcap-devel"
|
makedepends="readline-devel openssl-devel libcap-devel"
|
||||||
short_desc="The Network Time Protocol daemon and utilities"
|
short_desc="The Network Time Protocol daemon and utilities"
|
||||||
license="BSD"
|
license="BSD"
|
||||||
|
@ -12,22 +13,25 @@ homepage="http://www.ntp.org/"
|
||||||
distfiles="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$version.tar.gz"
|
distfiles="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$version.tar.gz"
|
||||||
checksum=d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c
|
checksum=d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c
|
||||||
|
|
||||||
subpackages="$pkgname-perl"
|
subpackages="ntp-perl"
|
||||||
conf_files="/etc/ntp.conf"
|
conf_files="/etc/ntp.conf"
|
||||||
systemd_services="ntpd.service on"
|
systemd_services="ntpdate.service on ntpd.service on"
|
||||||
|
system_accounts="ntpd"
|
||||||
provides="ntp-daemon-0"
|
provides="ntp-daemon-0"
|
||||||
replaces="ntp-daemon>=0"
|
replaces="ntp-daemon>=0"
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
|
# ntpd service
|
||||||
vinstall ${FILESDIR}/ntpd.service 644 usr/lib/systemd/system
|
vinstall ${FILESDIR}/ntpd.service 644 usr/lib/systemd/system
|
||||||
vinstall ${FILESDIR}/ntp.conf 644 etc
|
vinstall ${FILESDIR}/ntp.conf 644 etc
|
||||||
|
# ntpdate service
|
||||||
vmkdir usr/share/ntp
|
vinstall ${FILESDIR}/ntpdate.service 644 usr/lib/systemd/system
|
||||||
vmkdir usr/share/doc/ntp
|
|
||||||
vcopy html usr/share/doc/ntp
|
|
||||||
vcopy conf usr/share/ntp
|
|
||||||
|
|
||||||
# For systemd-timedated.
|
# For systemd-timedated.
|
||||||
vmkdir usr/lib/systemd/ntp-units.d
|
vmkdir usr/lib/systemd/ntp-units.d
|
||||||
echo "ntpd.service" > ${DESTDIR}/usr/lib/systemd/ntp-units.d/60-ntp.list
|
echo "ntpd.service" > ${DESTDIR}/usr/lib/systemd/ntp-units.d/60-ntp.list
|
||||||
|
# Convert html to manual pages.
|
||||||
|
cd html
|
||||||
|
../scripts/html2man
|
||||||
|
vmkdir usr/share/man
|
||||||
|
mv man/man* ${DESTDIR}/usr/share/man
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue