From: Samuel Matzek Date: Mon, 16 Jan 2017 17:11:31 +0000 (-0600) Subject: Ceph-disk to use correct user in check_journal_req X-Git-Tag: v12.0.0~136^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12947%2Fhead;p=ceph.git Ceph-disk to use correct user in check_journal_req The ceph-disk tool calls ceph-osd to check the journal requirements using OSD id 0. This creates a log file for osd-0 on the system using the current user/group for file permissions. When ceph-disk is run as root this makes the file owned by root which makes the osd daemon for osd.0 unable to write to its own log file. This commit changes the journal reqs calls of ceph-osd to pass the ceph user and group so ceph-osd creates the log file with the appropriate permissions. Fixes: http://tracker.ceph.com/issues/18538 Signed-off-by: Samuel Matzek --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index b9a2cc57a9cb..5283484ab00b 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -1425,16 +1425,22 @@ def check_journal_reqs(args): 'ceph-osd', '--check-allows-journal', '-i', '0', '--cluster', args.cluster, + '--setuser', get_ceph_user(), + '--setgroup', get_ceph_group(), ]) _, _, wants_journal = command([ 'ceph-osd', '--check-wants-journal', '-i', '0', '--cluster', args.cluster, + '--setuser', get_ceph_user(), + '--setgroup', get_ceph_group(), ]) _, _, needs_journal = command([ 'ceph-osd', '--check-needs-journal', '-i', '0', '--cluster', args.cluster, + '--setuser', get_ceph_user(), + '--setgroup', get_ceph_group(), ]) return (not allows_journal, not wants_journal, not needs_journal)