  
  ###### lock ########
  
-@@ -841,12 +845,34 @@
+@@ -841,12 +845,38 @@
      return osd_id
  
  def get_ceph_user():

+            return 'root'
+
+def get_ceph_group():
+    if CEPH_PREF_GROUP != None:
+        try:
+            grp.getgrnam(CEPH_PREF_GROUP)

             ],
         )
     # TODO ceph-osd --mkfs removes the monmap file?
@@ -3233,6 +3263,18 @@
         default='/etc/ceph',
         help='directory in which ceph configuration files are found (default /etc/ceph)',
         )
+    parser.add_argument(
+        '--setuser',
+        metavar='USER',
+        default=None,
+        help='use the given user for subprocesses, rather than ceph or root'
+        )
+    parser.add_argument(
+        '--setgroup',
+        metavar='GROUP',
+        default=None,
+        help='use the given group for subprocesses, rather than ceph or root'
+    )
     parser.set_defaults(
         # we want to hold on to this, for later
         prog=parser.prog,
@@ -3526,6 +3568,11 @@
     setup_statedir(args.statedir)
     setup_sysconfdir(args.sysconfdir)
 
+    global CEPH_PREF_USER
+    CEPH_PREF_USER = args.setuser
+    global CEPH_PREF_GROUP
+    CEPH_PREF_GROUP = args.setgroup
+
     if args.verbose:
         args.func(args)
     else:
