define prompt for root user in slice
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 19 Jun 2012 15:19:05 +0000 (17:19 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 19 Jun 2012 15:19:05 +0000 (17:19 +0200)
sliver_lxc.py

index a2b3432..6e2b725 100644 (file)
@@ -53,6 +53,11 @@ class Sliver_LXC(lv.Sliver_Libvirt):
         command = ['chmod', '755', containerDir]
         logger.log_call(command, timeout=15*60)
 
+        # customize prompt for slice owner
+        dot_profile=os.path.join(containerDir,"root/.profile")
+        with open(dot_profile,'w') as f:
+            f.write("export PS1='%s@\H \$ '\n"%(name))
+
         # TODO: set quotas...
 
         # Set hostname. A valid hostname cannot have '_'