From: Sage Weil Date: Mon, 30 Sep 2019 17:53:24 +0000 (-0500) Subject: ceph-daemon: make id portion of 'shell' optional X-Git-Tag: v15.1.0~1313^2~58 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be623683063c12777a2cd3ffcdd6da83efcbbc3f;p=ceph.git ceph-daemon: make id portion of 'shell' optional This lets you start up a 'generic' container of a particular class, without a data mount, but with the appropriate other mounts and privilege levels. Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 8d4db7289fbf..f9240a202e65 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -88,10 +88,13 @@ def get_legacy_fsid(cluster): def get_daemon_args(fsid, daemon_type, daemon_id): r = [ - '--default-admin-socket', '/var/run/ceph/' + fsid + '-' + daemon_type + '.' + daemon_id + '.asok', '--default-log-to-file=false', '--default-log-to-stderr=true', ] + if daemon_id: + r += ['--default-admin-socket', + '/var/run/ceph/' + fsid + '-' + daemon_type + '.' + daemon_id + + '.asok'] r += ['--setuser', 'ceph'] r += ['--setgroup', 'ceph'] return r @@ -604,7 +607,11 @@ def command_run(): ################################## def command_shell(): - (daemon_type, daemon_id) = args.name.split('.') + if '.' in args.name: + (daemon_type, daemon_id) = args.name.split('.') + else: + daemon_type = args.name + daemon_id = None (uid, gid) = extract_uid_gid() c = get_container(args.fsid, daemon_type, daemon_id) subprocess.call(c.shell_cmd())