Hello I was having a discussion with a colleague of mine on how `pasta` when invoked independently drops you in a new user and network namespace and how that causes some folks to not realize what has happened especially because there's no cue as to what transpired. This is not uncommon though, because a lot of times, folks having issues with pasta while running it with podman, tend to invoke pasta directly to debug. I interacted with Stefano regarding this and he told me that pasta already detaches the UTS namespace and so in order to address this issue, I propose that we set the hostname as part of `pasta_spawn_cmd()`.Doing this would provide users with a clear visual indication that they are in a new user namespace (among other ns but that won't be indicative here) and avoid issues similar to the aforementioned. I'm looking to gather more opinions on how this change, if implemented, would affect the functionality. Looking forward to the discussion. Thank you danishpraka.sh :wq
Hi Danish, On Thu, 9 May 2024 12:30:42 +0530 Danish Prakash <danish.prakash(a)suse.com> wrote:Hello I was having a discussion with a colleague of mine on how `pasta` when invoked independently drops you in a new user and network namespace and how that causes some folks to not realize what has happened especially because there's no cue as to what transpired. This is not uncommon though, because a lot of times, folks having issues with pasta while running it with podman, tend to invoke pasta directly to debug. I interacted with Stefano regarding this and he told me that pasta already detaches the UTS namespace and so in order to address this issue, I propose that we set the hostname as part of `pasta_spawn_cmd()`.Doing this would provide users with a clear visual indication that they are in a new user namespace (among other ns but that won't be indicative here) and avoid issues similar to the aforementioned. I'm looking to gather more opinions on how this change, if implemented, would affect the functionality. Looking forward to the discussion....I just realised one thing, probably solvable, while trying out some stuff with pasta on two different machines: if I didn't have the original hostname in the prompt, I would have had some issues telling them apart. But we could still retain the existing hostname and prefix with something like 'pasta-on-' (sure, we would need to truncate at 63 characters, but it shouldn't be a common case). What do you think? That would also help when you're running pasta-in-pasta-in-pasta-in... (or at least when I am running it ;)). Because usually I notice that I'm in a pasta-spawned terminal by looking at the prompt: I'm "root", but colours didn't change. What I can't tell from the prompt, though, is at what "level" I'm at (at least pasta-in-pasta is something I try very commonly to reproduce pasta's behaviour with particular network setups). Having root@pasta-on-pasta-on-machine would be a nice plus. -- Stefano
Hi, On 09/05/2024 09:00, Danish Prakash wrote:Hello I was having a discussion with a colleague of mine on how `pasta` when invoked independently drops you in a new user and network namespace and how that causes some folks to not realize what has happened especially because there's no cue as to what transpired. This is not uncommon though, because a lot of times, folks having issues with pasta while running it with podman, tend to invoke pasta directly to debug. I interacted with Stefano regarding this and he told me that pasta already detaches the UTS namespace and so in order to address this issue, I propose that we set the hostname as part of `pasta_spawn_cmd()`.Doing this would provide users with a clear visual indication that they are in a new user namespace (among other ns but that won't be indicative here) and avoid issues similar to the aforementioned. I'm looking to gather more opinions on how this change, if implemented, would affect the functionality. Looking forward to the discussion. Thank you danishpraka.sh :wqI don't have an issue with the hostname suggestion but it will not solve the problem of users not understanding that they are in a new user namespace. Maybe a more universal solution is to print a log line with a hint when no explicit command is given. Something like: "Spawning new shell in user+network namespace". That at least tells the user what pasta did and works even in cases where the prompt does not contain the hostname. Paul
I don't have an issue with the hostname suggestion but it will not solve the problem of users not understanding that they are in a new user namespace. Maybe a more universal solution is to print a log line with a hint when no explicit command is given. Something like: "Spawning new shell in user+network namespace". That at least tells the user what pasta did and works even in cases where the prompt does not contain the hostnameThat's a great suggestion but the reason I proposed modifying/setting the hostname was because it seemed to me a more subtle way to address this problem. However, printing to stdout doesn't help in situations where you're running pasta-in-pasta... as Stefano earlier pointed out. This solution of modifying and prefixing "pasta-" to the hostname works nicely in this case while also acting as a subtle indication that *something* has changed, not leaving the user entirely clueless. danishpraka.sh :wq On Mon, May 13, 2024 at 5:29 PM Paul Holzinger <pholzing(a)redhat.com> wrote:Hi, On 09/05/2024 09:00, Danish Prakash wrote:Hello I was having a discussion with a colleague of mine on how `pasta` when invoked independently drops you in a new user and network namespace and how that causes some folks to not realize what has happened especially because there's no cue as to what transpired. This is not uncommon though, because a lot of times, folks having issues with pasta while running it with podman, tend to invoke pasta directly to debug. I interacted with Stefano regarding this and he told me that pasta already detaches the UTS namespace and so in order to address this issue, I propose that we set the hostname as part of `pasta_spawn_cmd()`.Doing this would provide users with a clear visual indication that they are in a new user namespace (among other ns but that won't be indicative here) and avoid issues similar to the aforementioned. I'm looking to gather more opinions on how this change, if implemented, would affect the functionality. Looking forward to the discussion. Thank you danishpraka.sh :wqI don't have an issue with the hostname suggestion but it will not solve the problem of users not understanding that they are in a new user namespace. Maybe a more universal solution is to print a log line with a hint when no explicit command is given. Something like: "Spawning new shell in user+network namespace". That at least tells the user what pasta did and works even in cases where the prompt does not contain the hostname. Paul
On Mon, 13 May 2024 13:59:22 +0200 Paul Holzinger <pholzing(a)redhat.com> wrote:[...] I don't have an issue with the hostname suggestion but it will not solve the problem of users not understanding that they are in a new user namespace. Maybe a more universal solution is to print a log line with a hint when no explicit command is given. Something like: "Spawning new shell in user+network namespace". That at least tells the user what pasta did and works even in cases where the prompt does not contain the hostname.Hmm, sure, that's probably the clearest indication possible in the general case (minus the fact that it doesn't really help for pasta-in-pasta as Danish pointed out). On the other hand I would find it quite noisy, and the man page already explains what we're doing. Sure, one could run it with '-q', but then it's more typing just to avoid that noise. By the way, I'm (sloowly) reworking the website, and the namespacing aspect is something I plan to show in a separate diagram as well. Plus, I guess we wouldn't print that when a command is explicitly given, but then 'pasta' would print that message, while 'pasta -- sh' wouldn't, so things would quite easily look inconsistent. All in all, I have quite a preference against an additional message, but if more people on the list think it's a nice addition, then let's go for it. -- Stefano