ec66b5407b
--HG-- extra : convert_revision : 793ab32256093e95ae5f901d4055d2818b08c4cf
34 lines
741 B
Plaintext
34 lines
741 B
Plaintext
#
|
|
# This script creates the HAL system user/group.
|
|
#
|
|
|
|
case "${ACTION}" in
|
|
pre)
|
|
;;
|
|
post)
|
|
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
|
if ! getent group hal >/dev/null; then
|
|
groupadd -r hal 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created HAL system group."
|
|
fi
|
|
if ! getent passwd hal >/dev/null; then
|
|
useradd -c "HAL daemon" \
|
|
-d / -s /sbin/nologin -g hal \
|
|
-G optical,floppy,storage -r hal && \
|
|
passwd -l hal 2>&1 >/dev/null
|
|
[ $? -ne 0 ] && exit $?
|
|
echo "Created HAL system user."
|
|
fi
|
|
|
|
# Create some required dirs if don't exist.
|
|
if [ ! -d var/run/hald ]; then
|
|
mkdir -p var/run/hald
|
|
chown hal:hal var/run/hald
|
|
fi
|
|
if [ ! -d var/cache/hald ]; then
|
|
mkdir -p var/cache/hald
|
|
fi
|
|
;;
|
|
esac
|