2009-05-10 15:52:04 +00:00
|
|
|
#
|
|
|
|
# This script creates the ntpd system user/group.
|
|
|
|
#
|
|
|
|
|
|
|
|
case "${ACTION}" in
|
|
|
|
pre)
|
|
|
|
;;
|
|
|
|
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
|
2009-05-11 00:28:50 +00:00
|
|
|
|
|
|
|
# Fix ntpd initialization with -i (chrooted).
|
|
|
|
if [ ! -d var/chroot/ntpd/var/db ]; then
|
|
|
|
mkdir -p var/chroot/ntpd/var/db
|
|
|
|
chown ntpd:ntpd /var/chroot/ntpd/var/db
|
|
|
|
fi
|
2009-05-10 15:52:04 +00:00
|
|
|
;;
|
|
|
|
esac
|