mgr_id = args.mgr_id or generate_service_id()
logging.info('Cluster fsid: %s' % fsid)
+ l = FileLock(fsid)
+ l.acquire()
+
# config
cp = read_config(args.config)
if args.mon_ip:
# type: () -> None
(daemon_type, daemon_id) = args.name.split('.', 1)
+ l = FileLock(args.fsid)
+ l.acquire()
+
supported_daemons = list(Ceph.daemons)
supported_daemons.extend(Monitoring.components)
def command_adopt():
# type: () -> None
+
(daemon_type, daemon_id) = args.name.split('.', 1)
(uid, gid) = extract_uid_gid()
if args.style == 'legacy':
if not fsid:
raise Error('could not detect legacy fsid; set fsid in ceph.conf')
+ l = FileLock(fsid)
+ l.acquire()
+
data_dir_src = ('/var/lib/ceph/%s/%s-%s' %
(daemon_type, args.cluster, daemon_id))
data_dir_src = os.path.abspath(args.legacy_dir + data_dir_src)
def command_rm_daemon():
# type: () -> None
+
+ l = FileLock(args.fsid)
+ l.acquire()
+
(daemon_type, daemon_id) = args.name.split('.', 1)
if daemon_type in ['mon', 'osd'] and not args.force:
raise Error('must pass --force to proceed: '
raise Error('must pass --force to proceed: '
'this command may destroy precious data!')
+ l = FileLock(args.fsid)
+ l.acquire()
+
# stop + disable individual daemon units
for d in list_daemons(detail=False):
if d['fsid'] != args.fsid: