1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00
freebsd-ports/devel/dbus/pkg-install
Jean-Yves Lefort 830a25df1e The system daemon is running as messagebus:messagebus, so it does not
have the permission to remove its pid file and socket on exit. Put
these files in the /var/run/dbus directory, owned by
messagebus:messagebus.

Remove the files and directory on package deinstall.
2006-04-28 01:37:06 +00:00

39 lines
805 B
Bash

#!/bin/sh
case $2 in
POST-INSTALL)
USER=messagebus
GROUP=${USER}
UID=556
GID=${UID}
PW=/usr/sbin/pw
if ${PW} group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if ${PW} groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if ${PW} user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d "/nonexistent" -s /sbin/nologin -c "D-BUS Daemon User"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
/usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/dbus
exit 0
;;
esac