2009-03-23 07:38:24 +00:00
|
|
|
#
|
|
|
|
# This script creates the HAL system user/group.
|
|
|
|
#
|
|
|
|
|
2009-04-08 01:24:57 +00:00
|
|
|
case "${ACTION}" in
|
2009-03-23 07:38:24 +00:00
|
|
|
pre)
|
|
|
|
;;
|
|
|
|
post)
|
2009-04-08 01:24:57 +00:00
|
|
|
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
|
|
|
if ! getent group hal >/dev/null; then
|
|
|
|
groupadd -r hal 2>&1 >/dev/null
|
2009-03-23 07:38:24 +00:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created HAL system group."
|
|
|
|
fi
|
2009-04-08 01:24:57 +00:00
|
|
|
if ! getent passwd hal >/dev/null; then
|
|
|
|
useradd -c "HAL daemon" \
|
2009-03-23 07:38:24 +00:00
|
|
|
-d / -s /sbin/nologin -g hal \
|
|
|
|
-G optical,floppy,storage -r hal && \
|
2009-04-08 01:24:57 +00:00
|
|
|
passwd -l hal 2>&1 >/dev/null
|
2009-03-23 07:38:24 +00:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created HAL system user."
|
|
|
|
fi
|
2009-05-07 11:22:53 +00:00
|
|
|
|
2009-05-07 12:01:56 +00:00
|
|
|
# Create some required dirs if don't exist.
|
2009-05-07 11:22:53 +00:00
|
|
|
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
|
2009-03-23 07:38:24 +00:00
|
|
|
;;
|
|
|
|
esac
|