void-packages/templates/dbus/INSTALL
Juan RP 4e87160dec dbus: (INSTALL) also run getent via chroot.
--HG--
extra : convert_revision : 201163531cb8e1ecca7b974ab2654717755fb669
2009-03-22 03:57:14 +01:00

28 lines
732 B
Text

#
# This script fixes permissions for dbus-daemon-launch-helper
# and creates the dbus system user/group.
#
dbus_launch="./usr/libexec/dbus-daemon-launch-helper"
case "$2" in
pre)
;;
post)
echo "Running $3-$4 post installation hooks..."
if ! chroot . getent group dbus >/dev/null; then
chroot . groupadd -r dbus
[ $? -ne 0 ] && exit $?
echo "Created dbus system group."
fi
if ! chroot . getent passwd dbus >/dev/null; then
chroot . useradd -c "System message bus" \
-d /var/run/dbus \
-s /sbin/nologin -g dbus -r dbus && \
chroot . passwd -l dbus &>/dev/null
[ $? -ne 0 ] && exit $?
echo "Created dbus system user."
fi
chroot . chown root:dbus ${dbus_launch}
chroot . chmod 4750 ${dbus_launch}
;;
esac