* Setting hostname while spawning pasta
@ 2024-05-09 7:00 Danish Prakash
2024-05-10 17:03 ` Stefano Brivio
2024-05-13 11:59 ` Paul Holzinger
0 siblings, 2 replies; 7+ messages in thread
From: Danish Prakash @ 2024-05-09 7:00 UTC (permalink / raw)
To: passt-dev
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting hostname while spawning pasta
2024-05-09 7:00 Setting hostname while spawning pasta Danish Prakash
@ 2024-05-10 17:03 ` Stefano Brivio
[not found] ` <CACVuxaZEos=JK3XaFGM7d9z+qk-QLeChh7HuGxcdaEfmM02ywg@mail.gmail.com>
2024-05-13 11:59 ` Paul Holzinger
1 sibling, 1 reply; 7+ messages in thread
From: Stefano Brivio @ 2024-05-10 17:03 UTC (permalink / raw)
To: Danish Prakash; +Cc: passt-dev
Hi Danish,
On Thu, 9 May 2024 12:30:42 +0530
Danish Prakash <danish.prakash@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting hostname while spawning pasta
2024-05-09 7:00 Setting hostname while spawning pasta Danish Prakash
2024-05-10 17:03 ` Stefano Brivio
@ 2024-05-13 11:59 ` Paul Holzinger
2024-05-13 14:28 ` Danish Prakash
2024-05-13 16:02 ` Stefano Brivio
1 sibling, 2 replies; 7+ messages in thread
From: Paul Holzinger @ 2024-05-13 11:59 UTC (permalink / raw)
To: Danish Prakash, passt-dev, Stefano Brivio
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
> :wq
>
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.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting hostname while spawning pasta
2024-05-13 11:59 ` Paul Holzinger
@ 2024-05-13 14:28 ` Danish Prakash
2024-05-13 16:02 ` Stefano Brivio
1 sibling, 0 replies; 7+ messages in thread
From: Danish Prakash @ 2024-05-13 14:28 UTC (permalink / raw)
To: Paul Holzinger; +Cc: passt-dev, Stefano Brivio
> 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
That'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@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
> > :wq
> >
> 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.
>
> Paul
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting hostname while spawning pasta
2024-05-13 11:59 ` Paul Holzinger
2024-05-13 14:28 ` Danish Prakash
@ 2024-05-13 16:02 ` Stefano Brivio
1 sibling, 0 replies; 7+ messages in thread
From: Stefano Brivio @ 2024-05-13 16:02 UTC (permalink / raw)
To: Paul Holzinger; +Cc: Danish Prakash, passt-dev
On Mon, 13 May 2024 13:59:22 +0200
Paul Holzinger <pholzing@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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-05-13 16:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 7:00 Setting hostname while spawning pasta Danish Prakash
2024-05-10 17:03 ` Stefano Brivio
[not found] ` <CACVuxaZEos=JK3XaFGM7d9z+qk-QLeChh7HuGxcdaEfmM02ywg@mail.gmail.com>
2024-05-13 11:21 ` Stefano Brivio
2024-05-13 11:56 ` Danish Prakash
2024-05-13 11:59 ` Paul Holzinger
2024-05-13 14:28 ` Danish Prakash
2024-05-13 16:02 ` Stefano Brivio
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).