]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Ceph-disk to use correct user in check_journal_req 12947/head
authorSamuel Matzek <smatzek@us.ibm.com>
Mon, 16 Jan 2017 17:11:31 +0000 (11:11 -0600)
committerSamuel Matzek <smatzek@us.ibm.com>
Mon, 16 Jan 2017 17:22:37 +0000 (11:22 -0600)
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 <smatzek@us.ibm.com>
src/ceph-disk/ceph_disk/main.py

index b9a2cc57a9cbe64c51a26541ed0ed8df0b0f2027..5283484ab00ba3da36b77e50c28fbae1030f1efc 100755 (executable)
@@ -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)