debian: fix /var/lib/ceph/* directory ownership

These dirs are owned by the package; make sure they are owend by the ceph
user.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-04-24 10:28:31 -07:00
parent b8893f6b8a
commit 6532e1c486
3 changed files with 27 additions and 0 deletions

View File

@ -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)
:

11
debian/ceph.postinst vendored
View File

@ -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)
:

View File

@ -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)
: