Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2011 11:15:30 -0700
From:      "Devin Teske" <dteske@vicor.com>
To:        "'Teske, Devin'" <Devin.Teske@fisglobal.com>, "'Paul Schenkeveld'" <freebsd@psconsult.nl>, <freebsd-jail@freebsd.org>
Subject:   RE: Jail starts but doesn't start
Message-ID:  <004701cc10d0$947f6280$bd7e2780$@vicor.com>
In-Reply-To: <010901cc0b46$a93c4f60$fbb4ee20$@vicor.com>
References:  <BANLkTi=NmzigTQ%2BDDDUZsPZ8F6sajyBe3Q@mail.gmail.com> <20110505104048.GA34113@psconsult.nl> <010901cc0b46$a93c4f60$fbb4ee20$@vicor.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message-----
> From: owner-freebsd-jail@freebsd.org [mailto:owner-freebsd-jail@freebsd.o=
rg]
> On Behalf Of Paul Schenkeveld
> Sent: Thursday, May 05, 2011 3:41 AM
> To: freebsd-jail@freebsd.org
> Subject: Re: Jail starts but doesn't start
>
> On Wed, May 04, 2011 at 04:24:11PM -0700, Mickey Harvey wrote:
> > Hosts /etc/rc.conf
> >
> >=A0=A0=A0 1. ifconfig_bge0=3D"inet 192.168.224.11 netmask 255.255.255.0"
> >=A0=A0=A0 2. defaultrouter=3D"192.168.224.1"
> >=A0=A0=A0 3. sshd_enable=3D"YES"
> >=A0=A0=A0 4.
> >=A0=A0=A0 5. linux_enable=3D"YES"
> >=A0=A0=A0 6. zfs_enable=3D"YES"
> >=A0=A0=A0 7. jail_enable=3D"YES"
> >=A0=A0=A0 8. jail_list=3D"www0 dns0 smarty0 centos"
> >=A0=A0=A0 9.
> >=A0=A0=A0 10. ifconfig_bge0_alias0=3D"inet 192.168.224.12 netmask 255.25=
5.255.255"
> >=A0=A0=A0 11. jail_www0_rootdir=3D"/tank/jails/www0"
> >=A0=A0=A0 12. jail_www0_hostname=3D"www0"
> >=A0=A0=A0 13. jail_www0_ip=3D"192.168.224.12"
> >=A0=A0=A0 14. jail_www0_devfs_enable=3D"YES"
> >=A0=A0=A0 15. jail_www0_exec_stop=3D"/etc/rc.shutdown"
> >=A0=A0=A0 16.
> >=A0=A0=A0 17. #JAIL READY TO USE, JUST NEEDS APPROPRIATE FSTAB ENTRIES
> >=A0=A0=A0 18. #ENTRIES ARE IN LOADER.CONF
> >=A0=A0=A0 19. #TRIED TO BOOT WITH REQUIRED FSTAB BUT IT BROKE SO I REVER=
TED
> >=A0=A0=A0 20. #5/3/11 MH
> >=A0=A0=A0 21. #ifconfig_bge0_alias1=3D"inet 192.168.224.13 netmask 255.2=
55.255.255"
> >=A0=A0=A0 22. #jail_deb0_rootdir=3D"/tank/jails/deb0"
> >=A0=A0=A0 23. #jail_deb0_hostname=3D"deb0"
> >=A0=A0=A0 24. #jail_deb0_ip=3D"192.168.224.13"
> >=A0=A0=A0 25. #jail_deb0_devfs_enable=3D"YES"
> >=A0=A0=A0 26. #jail_deb0_exec_start=3D"/etc/init.d/rc 3"
> >=A0=A0=A0 27. #jail_deb0_exec_stop=3D"/etc/init.d/rc 0"
> >=A0=A0=A0 28. #jail_deb0_flags=3D"-l -u root"
> >=A0=A0=A0 29.
> >=A0=A0=A0 30. ifconfig_bge0_alias1=3D"inet 192.168.224.14 netmask 255.25=
5.255.255"
> >=A0=A0=A0 31. jail_dns0_rootdir=3D"/tank/jails/dns0"
> >=A0=A0=A0 32. jail_dns0_hostname=3D"dns0"
> >=A0=A0=A0 33. jail_dns0_ip=3D"192.168.224.14"
> >=A0=A0=A0 34. jail_dns0_devfs_enable=3D"YES"
> >=A0=A0=A0 35. jail_dns0_exec_stop=3D"/etc/rc.shutdown"
> >=A0=A0=A0 36.
> >=A0=A0=A0 37. ifconfig_bge0_alias2=3D"inet 192.168.224.15 netmask 255.25=
5.255.255"
> >=A0=A0=A0 38. jail_smarty0_rootdir=3D"/tank/jails/smarty0"
> >=A0=A0=A0 39. jail_smarty0_hostname=3D"smarty0"
> >=A0=A0=A0 40. jail_smarty0_ip=3D"192.168.224.15"
> >=A0=A0=A0 41. jail_smarty0_devfs_enable=3D"YES"
> >=A0=A0=A0 42. jail_smarty0_exec_stop=3D"/etc/rc.shutdown"
> >=A0=A0=A0 43.
> >=A0=A0=A0 44. ifconfig_bge0_alias3=3D"inet 192.168.224.16 netmask 255.25=
5.255.255"
> >=A0=A0=A0 45. jail_centos_rootdir=3D"/tank/jails/centos"
> >=A0=A0=A0 46. jail_centos_hostname=3D"centos"
> >=A0=A0=A0 47. jail_centos_ip=3D"192.168.224.16"
> >=A0=A0=A0 48. jail_centos_devfs_enable=3D"YES"
> >
> >
> > Result of jls after /etc/rc.d/jail start centos (notice there's no
> > entry for
> > centos)
> >
> >=A0=A0=A0 JID=A0 IP Address=A0=A0=A0=A0=A0 Hostname=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Path
> >=A0=A0=A0=A0=A0 1=A0 192.168.224.12=A0 www0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /tank/jails/www0
> >=A0=A0=A0=A0=A0 2=A0 192.168.224.14=A0 dns0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /tank/jails/dns0
> >=A0=A0=A0=A0=A0 3=A0 192.168.224.15=A0 smarty0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /tank/jails/smarty0
> >
> >
> > No error messages when starting or stopping centos jail.
> > /var/run contains jail_centos.id
> > Alias exists on bge0.
> >
> > So I tried "jexec 4 /bin/bash" figuring jls just isn't showing the
> > centos jail for some reason but:
> > jexec: jail_attach(4): Invalid argument
> >
> > Anybody have any idea about what might be happening here?
>
> This usually happens when there are no processes running in the jail to k=
eep
it
> up.=A0 By default, jails started thru rc.d/jail are not persistent.
> Try adding something like cron_enable=3D"YES" to rc.conf inside the jail.


The /etc/rc.d/jail script will (by default) run "/bin/sh /etc/rc" as the ja=
iled
process. On FreeBSD, /etc/rc is responsible for booting the system. By defa=
ult,
a vanilla FreeBSD jail will run syslogd, sendmail, and cron, all of which f=
ork
and daemonize, triply allowing the jail to persist.

CentOS -- which also has /etc/rc (as a symbolic link to /etc/rc.d/rc) --
meanwhile may not have any services that are enabled by default. I would ei=
ther

a. chroot(8) into the jail and use chkconfig(8) to enable something like cr=
on in
runlevel 5 (e.g. chkconfig --level 5 crond on)
or simply...
b. ln -sf ../init.d/crond /tank/jails/centos/etc/rc5.d/S90crond

On a side note: this is the first that I've ever heard that you could run C=
entOS
Linux in a FreeBSD jail. It should work -- afterall, my CentOS 4.7 box appe=
ars
to have /etc/rc as a symlink to /etc/rc.d/rc, so in-theory there should be =
no
problems with the /etc/rc.d/jail FreeBSD script from firing up a CentOS jail
(*cough* in-theory *cough*).

Do let me know how you fair.
--
Devin


_____________

The information contained in this message is proprietary and/or confidentia=
l. If you are not the intended recipient, please: (i) delete the message an=
d all copies; (ii) do not disclose, distribute or use the message in any ma=
nner; and (iii) notify the sender immediately. In addition, please be aware=
 that any message addressed to our domain is subject to archiving and revie=
w by persons other than the intended recipient. Thank you.
_____________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004701cc10d0$947f6280$bd7e2780$>