[Pkg-mongodb-maintainers] [pkg-mongodb] 375/394: postinst: fix directory permission handling
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Wed Sep 21 14:00:36 UTC 2016
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository pkg-mongodb.
commit 2a7cc6c0fc15b908382ef8d0626e5c198e39459e
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Thu Feb 11 00:33:47 2016 +0200
postinst: fix directory permission handling
- Drop the mkdir calls, the directories are created using
dh_installdirs.
- Use dpkg-statoverride instead of plain chown, to allow admins
to override the directory permissions.
---
debian/mongodb-server.postinst | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/debian/mongodb-server.postinst b/debian/mongodb-server.postinst
index 22b3006..aa9e3c3 100644
--- a/debian/mongodb-server.postinst
+++ b/debian/mongodb-server.postinst
@@ -25,13 +25,11 @@ case "$1" in
--home /var/lib/mongodb --no-create-home \
--quiet --group mongodb
- # create db -- note: this should agree with dbpath in mongodb.conf
- mkdir -p /var/lib/mongodb
- chown -R mongodb:mongodb /var/lib/mongodb
-
- # create logdir -- note: this should agree with logpath in mongodb.conf
- mkdir -p /var/log/mongodb
- chown -R mongodb:mongodb /var/log/mongodb
+ for dir in /var/lib/mongodb /var/log/mongodb; do
+ if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
+ dpkg-statoverride --update --add mongodb mongodb 0755 "$dir"
+ fi
+ done
;;
abort-upgrade|abort-remove|abort-deconfigure)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mongodb/pkg-mongodb.git
More information about the Pkg-mongodb-maintainers
mailing list