diff options
author | Ramon Fernandez <ramon@mongodb.com> | 2017-05-22 18:56:02 -0400 |
---|---|---|
committer | Ramon Fernandez <ramon@mongodb.com> | 2017-05-22 18:56:02 -0400 |
commit | cb1ea2ad2254ad9794138c366ef8737443dfc348 (patch) | |
tree | 0d15ca82f35d5708a65c8e783ed682336e8af9ab | |
parent | 5cc9a5e0622b7f4d4a907aaf3fad77330b245610 (diff) | |
download | mongo-cb1ea2ad2254ad9794138c366ef8737443dfc348.tar.gz |
SERVER-23516 Packages should not modify permissions when dbpath exists
-rw-r--r-- | debian/mongodb-enterprise-server.postinst | 24 | ||||
-rw-r--r-- | debian/mongodb-enterprise-unstable-server.postinst | 24 | ||||
-rw-r--r-- | debian/mongodb-org-server.postinst | 24 | ||||
-rw-r--r-- | debian/mongodb-org-unstable-server.postinst | 24 |
4 files changed, 56 insertions, 40 deletions
diff --git a/debian/mongodb-enterprise-server.postinst b/debian/mongodb-enterprise-server.postinst index 2914fb85631..52761cd3e3f 100644 --- a/debian/mongodb-enterprise-server.postinst +++ b/debian/mongodb-enterprise-server.postinst @@ -20,20 +20,24 @@ set -e case "$1" in configure) - # create a mongodb group and user + # create a mongodb group and user if ! getent passwd mongodb >/dev/null 2>&1; then - adduser --system --no-create-home mongodb - addgroup --system mongodb - adduser mongodb mongodb + adduser --system --no-create-home mongodb + addgroup --system mongodb + adduser mongodb mongodb fi - # create db -- note: this should agree with dbpath in mongod.conf - mkdir -p /var/lib/mongodb - chown -R mongodb:mongodb /var/lib/mongodb + # create db -- note: this should agree with dbpath in mongod.conf + if [ ! -d /var/lib/mongodb ]; then + mkdir -p /var/lib/mongodb + chown mongodb:mongodb /var/lib/mongodb + fi - # create logdir -- note: this should agree with logpath in mongod.conf - mkdir -p /var/log/mongodb - chown -R mongodb:mongodb /var/log/mongodb + # create logdir -- note: this should agree with logpath in mongod.conf + if [ ! -d /var/log/mongodb ]; then + mkdir -p /var/log/mongodb + chown mongodb:mongodb /var/log/mongodb + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/mongodb-enterprise-unstable-server.postinst b/debian/mongodb-enterprise-unstable-server.postinst index 2914fb85631..52761cd3e3f 100644 --- a/debian/mongodb-enterprise-unstable-server.postinst +++ b/debian/mongodb-enterprise-unstable-server.postinst @@ -20,20 +20,24 @@ set -e case "$1" in configure) - # create a mongodb group and user + # create a mongodb group and user if ! getent passwd mongodb >/dev/null 2>&1; then - adduser --system --no-create-home mongodb - addgroup --system mongodb - adduser mongodb mongodb + adduser --system --no-create-home mongodb + addgroup --system mongodb + adduser mongodb mongodb fi - # create db -- note: this should agree with dbpath in mongod.conf - mkdir -p /var/lib/mongodb - chown -R mongodb:mongodb /var/lib/mongodb + # create db -- note: this should agree with dbpath in mongod.conf + if [ ! -d /var/lib/mongodb ]; then + mkdir -p /var/lib/mongodb + chown mongodb:mongodb /var/lib/mongodb + fi - # create logdir -- note: this should agree with logpath in mongod.conf - mkdir -p /var/log/mongodb - chown -R mongodb:mongodb /var/log/mongodb + # create logdir -- note: this should agree with logpath in mongod.conf + if [ ! -d /var/log/mongodb ]; then + mkdir -p /var/log/mongodb + chown mongodb:mongodb /var/log/mongodb + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/mongodb-org-server.postinst b/debian/mongodb-org-server.postinst index 2914fb85631..52761cd3e3f 100644 --- a/debian/mongodb-org-server.postinst +++ b/debian/mongodb-org-server.postinst @@ -20,20 +20,24 @@ set -e case "$1" in configure) - # create a mongodb group and user + # create a mongodb group and user if ! getent passwd mongodb >/dev/null 2>&1; then - adduser --system --no-create-home mongodb - addgroup --system mongodb - adduser mongodb mongodb + adduser --system --no-create-home mongodb + addgroup --system mongodb + adduser mongodb mongodb fi - # create db -- note: this should agree with dbpath in mongod.conf - mkdir -p /var/lib/mongodb - chown -R mongodb:mongodb /var/lib/mongodb + # create db -- note: this should agree with dbpath in mongod.conf + if [ ! -d /var/lib/mongodb ]; then + mkdir -p /var/lib/mongodb + chown mongodb:mongodb /var/lib/mongodb + fi - # create logdir -- note: this should agree with logpath in mongod.conf - mkdir -p /var/log/mongodb - chown -R mongodb:mongodb /var/log/mongodb + # create logdir -- note: this should agree with logpath in mongod.conf + if [ ! -d /var/log/mongodb ]; then + mkdir -p /var/log/mongodb + chown mongodb:mongodb /var/log/mongodb + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/mongodb-org-unstable-server.postinst b/debian/mongodb-org-unstable-server.postinst index 2914fb85631..52761cd3e3f 100644 --- a/debian/mongodb-org-unstable-server.postinst +++ b/debian/mongodb-org-unstable-server.postinst @@ -20,20 +20,24 @@ set -e case "$1" in configure) - # create a mongodb group and user + # create a mongodb group and user if ! getent passwd mongodb >/dev/null 2>&1; then - adduser --system --no-create-home mongodb - addgroup --system mongodb - adduser mongodb mongodb + adduser --system --no-create-home mongodb + addgroup --system mongodb + adduser mongodb mongodb fi - # create db -- note: this should agree with dbpath in mongod.conf - mkdir -p /var/lib/mongodb - chown -R mongodb:mongodb /var/lib/mongodb + # create db -- note: this should agree with dbpath in mongod.conf + if [ ! -d /var/lib/mongodb ]; then + mkdir -p /var/lib/mongodb + chown mongodb:mongodb /var/lib/mongodb + fi - # create logdir -- note: this should agree with logpath in mongod.conf - mkdir -p /var/log/mongodb - chown -R mongodb:mongodb /var/log/mongodb + # create logdir -- note: this should agree with logpath in mongod.conf + if [ ! -d /var/log/mongodb ]; then + mkdir -p /var/log/mongodb + chown mongodb:mongodb /var/log/mongodb + fi ;; abort-upgrade|abort-remove|abort-deconfigure) |