jls Showing Multiple JIDs per Jail

On

Code:
# uname
FreeBSD 8.1-RELEASE-p4 amd64

jls is showing multiple jails for individual jails created with

Code:
# ezjail-admin create

The output is like this:

Code:
# jls
   JID  IP Address      Hostname                      Path
     1  192.x.x.1       jail1                         /usr/jails/jail1
     2  192.x.x.2       jail2                         /usr/jails/jail2
     3  192.x.x.3       jail3                         /usr/jails/jail3
     4  192.x.x.2       jail2                         /usr/jails/jail2
     7  192.x.x.1       jail1                         /usr/jails/jail1

Are multiple instances of jail1 and jail2 running, and if so what is causing this?
 
I don't know what is causing it, but you can check whether they are running or not by

Code:
# jexec 4 hostname
# jexec 7 hostname

If it returns their hostname, then they are running.
 
I've not seen that one before -- and I am not sure how you got things into that state. I recommend stopping the duplicated jails (both instances, if needed), and then starting them again.
 
So this is kind of weird. After running
Code:
# /usr/local/etc/rc.d/ezjail.sh stop jail2

I get
Code:
# jls
   JID  IP Address      Hostname                      Path
     1  192.x.x.1       jail1                         /usr/jails/jail1
     3  192.x.x.3       jail3                         /usr/jails/jail3
     4  192.x.x.2       jail2                         /usr/jails/jail2
     7  192.x.x.1       jail1                         /usr/jails/jail1

Then jexec stops working for jid 4, but the services running on jail2 are still accessible.
 
You have to use the ezjail-admin stop command. You can not mix native jail commands with ezjail. ezjail keeps a internal list of jails started by ezjail and when you go outside of ezjail-admin to stop a jail ezjail don't know about it.

Check out qjail which is much better than ezjail.
 
fbsd1 said:
You have to use the ezjail-admin stop command. You can not mix native jail commands with ezjail. ezjail keeps a internal list of jails started by ezjail and when you go outside of ezjail-admin to stop a jail ezjail don't know about it.

Check out qjail which is much better than ezjail.

Multiple jails are being created without issuing a stop command, but I'm using ezjail.sh after the redundant jails are created, which should work fine.

I looked at qjail's sourceforge site, but I couldn't find any documentation. How is it an improvement over ezjail?
 
Apparently what is happening is that the apache22 stop command is not seeing the pid, so I get the following when I try to stop it:
Code:
# /usr/local/etc/rc.d/apache22 stop
apache22 not running? (check /var/run/httpd.pid).
Even though the pid file is there
Code:
# cat /var/run/httpd.pid
1379

Restarting Apache then creates another jid for the same jail somehow. I tried it twice, so now I have three jids running for the same jail

The quick fix is just to restart the jail instead of the services in it, but I would be interested to see if anyone knows why it is not seeing the pid file and why restarting it creates the second jail.
 
Back
Top