Skip to content

Commit 6532e1c

Browse files
committed
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 <[email protected]>
1 parent b8893f6 commit 6532e1c

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

debian/ceph-mds.postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ set -e
1818
# for details, see http://www.debian.org/doc/debian-policy/ or
1919
# the debian-policy package
2020

21+
[ -f "/etc/default/ceph" ] && . /etc/default/ceph
22+
[ -z "$SERVER_USER" ] && SERVER_USER=ceph
23+
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
2124

2225
case "$1" in
2326
configure)
2427
[ -x /sbin/start ] && start ceph-mds-all || :
28+
29+
if ! dpkg-statoverride --list /var/lib/ceph/mds >/dev/null
30+
then
31+
chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/mds
32+
fi
2533
;;
2634
abort-upgrade|abort-remove|abort-deconfigure)
2735
:

debian/ceph.postinst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,22 @@ set -e
2424
# for details, see http://www.debian.org/doc/debian-policy/ or
2525
# the debian-policy package
2626

27+
[ -f "/etc/default/ceph" ] && . /etc/default/ceph
28+
[ -z "$SERVER_USER" ] && SERVER_USER=ceph
29+
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
2730

2831
case "$1" in
2932
configure)
3033
rm -f /etc/init/ceph.conf
3134
[ -x /sbin/start ] && start ceph-all || :
35+
36+
# adjust file and directory permissions
37+
for DIR in /var/lib/ceph/* ; do
38+
if ! dpkg-statoverride --list $DIR >/dev/null
39+
then
40+
chown $SERVER_USER:$SERVER_GROUP $DIR
41+
fi
42+
done
3243
;;
3344
abort-upgrade|abort-remove|abort-deconfigure)
3445
:

debian/radosgw.postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ set -e
2424
# for details, see http://www.debian.org/doc/debian-policy/ or
2525
# the debian-policy package
2626

27+
[ -f "/etc/default/ceph" ] && . /etc/default/ceph
28+
[ -z "$SERVER_USER" ] && SERVER_USER=ceph
29+
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph
2730

2831
case "$1" in
2932
configure)
3033
[ -x /sbin/start ] && start radosgw-all || :
34+
35+
if ! dpkg-statoverride --list /var/lib/ceph/radosgw >/dev/null
36+
then
37+
chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/radosgw
38+
fi
3139
;;
3240
abort-upgrade|abort-remove|abort-deconfigure)
3341
:

0 commit comments

Comments
 (0)