summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/ceph-mds.postinst8
-rw-r--r--debian/ceph.postinst11
-rw-r--r--debian/radosgw.postinst8
3 files changed, 27 insertions, 0 deletions
diff --git a/debian/ceph-mds.postinst b/debian/ceph-mds.postinst
index 66b3b5fc2d7..b69efedaafb 100644
--- a/debian/ceph-mds.postinst
+++ b/debian/ceph-mds.postinst
@@ -18,10 +18,18 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+[ -f "/etc/default/ceph" ] && . /etc/default/ceph
+[ -z "$SERVER_USER" ] && SERVER_USER=ceph
+[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
case "$1" in
configure)
[ -x /sbin/start ] && start ceph-mds-all || :
+
+ if ! dpkg-statoverride --list /var/lib/ceph/mds >/dev/null
+ then
+ chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/mds
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
:
diff --git a/debian/ceph.postinst b/debian/ceph.postinst
index 5d64f640b99..75eeb59c624 100644
--- a/debian/ceph.postinst
+++ b/debian/ceph.postinst
@@ -24,11 +24,22 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+[ -f "/etc/default/ceph" ] && . /etc/default/ceph
+[ -z "$SERVER_USER" ] && SERVER_USER=ceph
+[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
case "$1" in
configure)
rm -f /etc/init/ceph.conf
[ -x /sbin/start ] && start ceph-all || :
+
+ # adjust file and directory permissions
+ for DIR in /var/lib/ceph/* ; do
+ if ! dpkg-statoverride --list $DIR >/dev/null
+ then
+ chown $SERVER_USER:$SERVER_GROUP $DIR
+ fi
+ done
;;
abort-upgrade|abort-remove|abort-deconfigure)
:
diff --git a/debian/radosgw.postinst b/debian/radosgw.postinst
index f3468bc60bf..07e3ec30b6d 100644
--- a/debian/radosgw.postinst
+++ b/debian/radosgw.postinst
@@ -24,10 +24,18 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+[ -f "/etc/default/ceph" ] && . /etc/default/ceph
+[ -z "$SERVER_USER" ] && SERVER_USER=ceph
+[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
case "$1" in
configure)
[ -x /sbin/start ] && start radosgw-all || :
+
+ if ! dpkg-statoverride --list /var/lib/ceph/radosgw >/dev/null
+ then
+ chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/radosgw
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
: