Skip to content

Commit

Permalink
Add group for diamond at install time
Browse files Browse the repository at this point in the history
Also add a diamond group when installing the Debian package.
Fixes python-diamond#80
  • Loading branch information
deejay1 committed Mar 12, 2015
1 parent eb224b7 commit cb83d8e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ set -e

case "$1" in
configure)
if ! getent group diamond >/dev/null ; then
addgroup --quiet --system diamond >/dev/null
fi
if ! getent passwd diamond >/dev/null; then
adduser --quiet --system --no-create-home --home /var/log/diamond --shell /usr/sbin/nologin diamond
adduser --quiet --system --no-create-home --home /var/log/diamond \
--ingroup diamond \
--shell /usr/sbin/nologin diamond
fi
;;

Expand All @@ -47,6 +52,6 @@ chmod -x /usr/bin/diamond
chmod +x /usr/bin/diamond

# Log / Run directory permissions
chown -R diamond /var/log/diamond
chown -R diamond:diamond /var/log/diamond

exit 0

0 comments on commit cb83d8e

Please sign in to comment.