From: Sage Weil Date: Mon, 24 Feb 2020 19:26:17 +0000 (-0600) Subject: cephadm: shell: make a root home dir (/root) in /var/log/ceph/$fsid/home X-Git-Tag: v15.1.1~238^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4b40899ec3f41993d4f654e3c7d077900ce9854f;p=ceph-ci.git cephadm: shell: make a root home dir (/root) in /var/log/ceph/$fsid/home This makes the shell much more friendly to humans. Signed-off-by: Sage Weil --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index e2320f106fe..b1cc74bc88f 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2159,6 +2159,17 @@ def command_shell(): '-e', 'LANG=C', '-e', "PS1=%s" % CUSTOM_PS1, ] + if args.fsid: + home = os.path.join(args.data_dir, args.fsid, 'home') + if not os.path.exists(home): + logger.debug('Creating root home at %s' % home) + makedirs(home, 0, 0, 0o660) + if os.path.exists('/etc/skel'): + for f in os.listdir('/etc/skel'): + if f.startswith('.bash'): + shutil.copyfile(os.path.join('/etc/skel', f), + os.path.join(home, f)) + mounts[home] = '/root' c = CephContainer( image=args.image,