]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: shell: make a root home dir (/root) in /var/log/ceph/$fsid/home 33519/head
authorSage Weil <sage@redhat.com>
Mon, 24 Feb 2020 19:26:17 +0000 (13:26 -0600)
committerSage Weil <sage@redhat.com>
Wed, 26 Feb 2020 16:53:38 +0000 (10:53 -0600)
This makes the shell much more friendly to humans.

Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index e2320f106fe21da3a12f832a303abbdf602ff0b8..b1cc74bc88f047cf36a1aae88575e73a510ff338 100755 (executable)
@@ -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,