ntp: use trigger to (un)register system user/groups, bumprev.
--HG-- extra : convert_revision : a1d80ce1080681ea8aaad532b22b739337c9e247
This commit is contained in:
parent
0092bfdf05
commit
0976eba38f
3 changed files with 4 additions and 30 deletions
|
@ -1,26 +1,11 @@
|
||||||
#
|
#
|
||||||
# This script creates the ntpd system user/group.
|
# This script creates required dirs for chroot initialization.
|
||||||
#
|
#
|
||||||
|
|
||||||
case "${ACTION}" in
|
case "${ACTION}" in
|
||||||
pre)
|
pre)
|
||||||
;;
|
;;
|
||||||
post)
|
post)
|
||||||
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
|
||||||
if ! getent group ntpd >/dev/null; then
|
|
||||||
groupadd -r ntpd 2>&1 >/dev/null
|
|
||||||
[ $? -ne 0 ] && exit $?
|
|
||||||
echo "Created ntpd system group."
|
|
||||||
fi
|
|
||||||
if ! getent passwd ntpd >/dev/null; then
|
|
||||||
useradd -c "Network Time Protocol Daemon" \
|
|
||||||
-d /var/chroot/ntpd \
|
|
||||||
-s /sbin/nologin -g ntpd -r ntpd && \
|
|
||||||
passwd -l ntpd 2>&1 >/dev/null
|
|
||||||
[ $? -ne 0 ] && exit $?
|
|
||||||
echo "Created ntpd system user."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Fix ntpd initialization with -i (chrooted).
|
# Fix ntpd initialization with -i (chrooted).
|
||||||
if [ ! -d var/chroot/ntpd/var/db ]; then
|
if [ ! -d var/chroot/ntpd/var/db ]; then
|
||||||
mkdir -p var/chroot/ntpd/var/db
|
mkdir -p var/chroot/ntpd/var/db
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#
|
|
||||||
# This script removes the ntpd user/group.
|
|
||||||
#
|
|
||||||
case "${ACTION}" in
|
|
||||||
pre)
|
|
||||||
if [ "$UPDATE" = "no" ]; then
|
|
||||||
userdel ntpd 2>&1 >/dev/null
|
|
||||||
[ $? -eq 0 ] && echo "Removed ntpd system user/group."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
post)
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'ntp'
|
# Template file for 'ntp'
|
||||||
pkgname=ntp
|
pkgname=ntp
|
||||||
version=4.2.4p8
|
version=4.2.4p8
|
||||||
revision=1
|
revision=2
|
||||||
distfiles="http://archive.ntp.org/ntp4/$pkgname-$version.tar.gz"
|
distfiles="http://archive.ntp.org/ntp4/$pkgname-$version.tar.gz"
|
||||||
build_style=gnu_configure
|
build_style=gnu_configure
|
||||||
configure_args="--enable-linuxcaps --enable-getifaddrs=glibc
|
configure_args="--enable-linuxcaps --enable-getifaddrs=glibc
|
||||||
|
@ -19,6 +19,8 @@ long_desc="
|
||||||
subpackages="$pkgname-perl"
|
subpackages="$pkgname-perl"
|
||||||
conf_files="/etc/ntp.conf"
|
conf_files="/etc/ntp.conf"
|
||||||
openrc_services="ntpd default"
|
openrc_services="ntpd default"
|
||||||
|
system_accounts="ntpd"
|
||||||
|
ntpd_homedir="/var/chroot/ntpd"
|
||||||
|
|
||||||
Add_dependency run glibc
|
Add_dependency run glibc
|
||||||
Add_dependency run readline
|
Add_dependency run readline
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue