]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
switch2container: chown symlink for devices
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 15 Sep 2020 13:59:06 +0000 (09:59 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 15 Sep 2020 19:30:21 +0000 (15:30 -0400)
commit05d4e76d4254e6ae732ec8a162240e47da69d410
tree850f728b55447dcf5ee8d41eeb4ffc36a1633515
parentdac0415d7570aa9a60dce255063a5a8e02036b8a
switch2container: chown symlink for devices

If the OSD directory is using symlinks for referencing devices (like
block, db, wal for bluestore and journal for filestore) then the chown
command could fail to change the owner:group on some system.

$ ls -hl /var/lib/ceph/osd/ceph-0/
total 28K
lrwxrwxrwx 1 ceph ceph 92 Sep 15 01:53 block -> /dev/ceph-45113532-95ca-471b-bd75-51de46f1339c/osd-data-570a1aee-60c0-44c9-8036-ffed7d67a4e6
-rw------- 1 ceph ceph 37 Sep 15 01:53 ceph_fsid
-rw------- 1 ceph ceph 37 Sep 15 01:53 fsid
-rw------- 1 ceph ceph 55 Sep 15 01:53 keyring
-rw------- 1 ceph ceph  6 Sep 15 01:53 ready
-rw------- 1 ceph ceph  3 Sep 15 02:00 require_osd_release
-rw------- 1 ceph ceph 10 Sep 15 01:53 type
-rw------- 1 ceph ceph  2 Sep 15 01:53 whoami
$ find /var/lib/ceph/osd/ceph-0 -not -user 167 -execdir chown 167:167 {} +
chown: cannot dereference './block': Permission denied
$ find /var/lib/ceph/osd/ceph-0 -not -user 167
/var/lib/ceph/osd/ceph-0/block

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit da4280e243f50114e1ae6455a46360012feb8f3d)
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml