Solved [Solved] Starting jails: cannot start jail "domain_com":

Hey guys,

I just updated from 8.1-RC_ to 8.4-STABLE and now when I'm trying to run jails with ezjail I'm getting:
Code:
[root@dream]:/var/jails/domain.com# /usr/local/etc/rc.d/ezjail start domain.com
Configuring jails:.
Starting jails: cannot start jail "domain_com":
.
Exit 1

I already did ezjail-admin update -i so I installed a new world.

Also I tried this:
Code:
[root@dream]:/var/jails/domain.com# jail -c path=/var/jails/domain.com host.hostname=domain.com ip4.addr=78.46.91.55 command=/bin/sh /etc/rc
jail: execvp: /bin/sh: No such file or directory
Exit 1

I spent a few hours of googling and making it work but still don't know how to fix it.

Any suggestions?
 
Re: Starting jails: cannot start jail "domain_com":

I just noticed that when I'm doing all steps manually, like
Code:
mount_nullfs /var/jails/basejail /var/jails/domain.com/basejail/
jail -c path=/var/jails/domain.com host.hostname=domain.com ip4.addr=78.46.91.55 command=/bin/sh /etc/rc
it works. But when I'm trying to run jail with ezjail, it doesn't work and doing umount /var/jails/domain.com/basejail.
 
Re: Starting jails: cannot start jail "domain_com":

@fonz, sorry. It's just 1am, I want to sleep but need to fix it before that.
 
Last edited by a moderator:
Re: Starting jails: cannot start jail "domain_com":

I don't use ezjail myself (I prefer to do it all manually), but you'll probably want to post your ezjail configuration file. That might make it a lot easier for others to help you.

Edit: When/if you do post any configuration files, please do enclose them in [ CODE ] tags ;) Thank you.
 
Re: Starting jails: cannot start jail "domain_com":

@@fonz, usually I'm doing it, but now I missed it because I'm too tired :\

I found the issue. It seems like it's a bug in /etc/rc.d/jail.

Code:
+ eval '_x="$jail_domain_com_ip_multi0"'
+ _x=''
+ break
+ echo ' cannot start jail "domain_com": '
 cannot start jail "domain_com":
+ tail +2 /tmp/jail.QyAM1zRA/jail.95009
jail: unknown parameter: ip6.addr            <----------------------
+ rm -f /tmp/jail.QyAM1zRA/jail.95009
+ rmdir /tmp/jail.QyAM1zRA
+ echo .

And it really seems like the following patch resolves this issue:
Code:
***************
*** 647,653 ****
                done

                eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \
!                       ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1

                if [ "$?" -eq 0 ] ; then
                        _jail_id=$(head -1 ${_tmp_jail})
--- 647,653 ----
                done

                eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \
!                       ip4.addr=\"${_addrl}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1

                if [ "$?" -eq 0 ] ; then
                        _jail_id=$(head -1 ${_tmp_jail})
 
Last edited by a moderator:
Re: Starting jails: cannot start jail "domain_com":

I'm glad to hear you managed to work it out. And thanks for sharing. When you've rested, you might want to consider submitting a PR and include your patch in the report.
 
I don't think this is a bug in /etc/rc.d/jail. The ip6.addr option has been there since 8.0. So it looks like there's something wrong with your local /usr/sbin/jail. Did you perhaps build world with WITHOUT_INET6 and/or WITHOUT_INET6_SUPPORT set?
 
Yep, my environment was built WITHOUT_INET6 and that's why /etc/rc.d/jail broke. I think It's definitely bug, because In some parts of the /etc/rc.d/jail script I can see checks for choosing the IP version.
 
r00ty said:
Yep, my environment was built WITHOUT_INET6 and that's why /etc/rc.d/jail broke. I think It's definitely bug, because In some parts of the /etc/rc.d/jail script I can see checks for choosing the IP version.
Just out of curiosity: did you by any chance configure anything IPv6 related in your jail configuration?

Because if you did then I don't think you can consider this a bug, yet if you didn't then it does look a bit odd to me as well. I just went over some of the jail documentation, including a list of known problems and bugs (on the FreeBSD wiki) and this issue doesn't seem to be mentioned there.
 
@ShelLuser,

I didn't do any configuration related to IPv6 at all. You can check the /etc/rc.d/jail rc.d script and you can notice that you don't need to do any IPv6 configuration to call jail with the argument ip6.addr. There is no check section to determine what version of IP is in use.
 
Last edited by a moderator:
Back
Top