vp-build/templates/hal/INSTALL
Juan RP 250b7f4446 hal: create /var/run/hald and /var/cache/hald at post-install.
These dirs are required for HAL at startup. Bump revision.

--HG--
extra : convert_revision : 0b9e1043c3baf692a7d85ffa9f81ea44f8ca41cc
2009-05-07 11:22:53 +00:00

34 lines
742 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