Ok this is going to be a long one and I REALLY need the mods and smart guys on here to read this, because I think this is a bug, I just don't know with what exactly. I'll try to be as brief as possible but as descriptive as necessary.
Description
I have a set of GUI jails connected to the /tmp/.X11-unix socket. I mostly try to stay with Falkon as a browser, but unfortunately it's not always possible (damn you reddit). For the first time recently, I wanted to run two instances of Firefox simultaneously in different jails, and hit a problem.
With Firefox already running in jail "social" , I tried to launch another instance in a jail called "browsing". All of the user accounts in my jails are just called "user", and my host is "root@dom0"
*note: I don't know another way to launch an X11 program with jexec without using 'csh -c' to do it.
But the Firefox window which pops up, is not from the jail "browsing", but from the jail "social". Whichever jail launches the first instance of Firefox will continue to launch Firefox, even if I do the following:
or even if I try this:
If I specify the root user for the jail, Firefox will launch correctly; HOWEVER, if I open a 3rd jail and try to launch with the root user or "user" user, same bug.
Conclusions?
Ok so this seems to have something to do with having the same user name across jails, in combintation with the way Firefox launches, and quite likely somehow tied in to the shared .X11-unix socket. However, I can't rule out jexec as having some culpability here, as it ought to be launching applications in the correct jail, although maybe some FreeBSD devs would say that sharing the .X11 socket is bound to cause these issues. I am but a script kiddie, not a dev, so please forgive my ignorance.
Workarounds
The obvious is to stop calling the unprivileged user "user" in my jails, and name them probably after the jail itself. Okay I have some really cool shell scripts for controlling jails that will need to be reworked, and there will be a loss of convenience and added complexity for my really awesome scripts that do things like automate jail creation/deletion, and create temporary disposable jails.
Smart guys, what do you think? Bug or not?
Description
I have a set of GUI jails connected to the /tmp/.X11-unix socket. I mostly try to stay with Falkon as a browser, but unfortunately it's not always possible (damn you reddit). For the first time recently, I wanted to run two instances of Firefox simultaneously in different jails, and hit a problem.
With Firefox already running in jail "social" , I tried to launch another instance in a jail called "browsing". All of the user accounts in my jails are just called "user", and my host is "root@dom0"
root@dom0:~ # jexec -l -U user browsing csh -c firefox
*note: I don't know another way to launch an X11 program with jexec without using 'csh -c' to do it.
But the Firefox window which pops up, is not from the jail "browsing", but from the jail "social". Whichever jail launches the first instance of Firefox will continue to launch Firefox, even if I do the following:
root@dom0:~ # jexec -l -U user browsing csh
user@browsing:~ % firefox
or even if I try this:
root@dom0:~ # jexec -l -U user browsing csh -c xterm
[xterm window pops up]
user@browsing:~ % firefox
If I specify the root user for the jail, Firefox will launch correctly; HOWEVER, if I open a 3rd jail and try to launch with the root user or "user" user, same bug.
Conclusions?
Ok so this seems to have something to do with having the same user name across jails, in combintation with the way Firefox launches, and quite likely somehow tied in to the shared .X11-unix socket. However, I can't rule out jexec as having some culpability here, as it ought to be launching applications in the correct jail, although maybe some FreeBSD devs would say that sharing the .X11 socket is bound to cause these issues. I am but a script kiddie, not a dev, so please forgive my ignorance.
Workarounds
The obvious is to stop calling the unprivileged user "user" in my jails, and name them probably after the jail itself. Okay I have some really cool shell scripts for controlling jails that will need to be reworked, and there will be a loss of convenience and added complexity for my really awesome scripts that do things like automate jail creation/deletion, and create temporary disposable jails.
Smart guys, what do you think? Bug or not?