From: Tim Serong Date: Thu, 23 Apr 2020 06:27:46 +0000 (+1000) Subject: cephadm: Add `chown` to unit.run for adoped simple OSDs X-Git-Tag: v16.1.0~2420^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6afa31d1f9ec62535a8a605dcf9c37de73ccf40a;p=ceph.git cephadm: Add `chown` to unit.run for adoped simple OSDs We're not using `ceph-volume simple activate` anymore, so need to add `chown ceph:ceph` for each of block, block.db and block.wal to ensure old-style simple OSDs are able to start. Fixes: https://tracker.ceph.com/issues/45129 Signed-off-by: Tim Serong --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index dfce8eb26d24..33b05c584c15 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1786,6 +1786,11 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c, if daemon_type == 'osd': # osds have a pre-start step assert osd_fsid + f.write('# Simple OSDs need chown on startup:\n') + for n in ['block', 'block.db', 'block.wal']: + p = os.path.join(data_dir, n) + f.write('[ ! -L {p} ] || chown {uid}:{gid} {p}\n'.format(p=p, uid=uid, gid=gid)) + f.write('# LVM OSDs use ceph-volume lvm activate:\n') prestart = CephContainer( image=args.image, entrypoint='/usr/sbin/ceph-volume',