From owner-freebsd-jail@FreeBSD.ORG Thu May 5 10:40:56 2011 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACB171065678 for ; Thu, 5 May 2011 10:40:56 +0000 (UTC) (envelope-from freebsd@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3D18FC12 for ; Thu, 5 May 2011 10:40:56 +0000 (UTC) Received: from mx1.psconsult.nl (psc11.adsl.iaf.nl [80.89.238.138]) by mx1.psconsult.nl (8.14.4/8.14.4) with ESMTP id p45AemN5034233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 5 May 2011 12:40:54 +0200 (CEST) (envelope-from freebsd@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.4/8.14.4/Submit) id p45AemeZ034232 for freebsd-jail@freebsd.org; Thu, 5 May 2011 12:40:48 +0200 (CEST) (envelope-from freebsd@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to freebsd@psconsult.nl using -f Date: Thu, 5 May 2011 12:40:48 +0200 From: Paul Schenkeveld To: freebsd-jail@freebsd.org Message-ID: <20110505104048.GA34113@psconsult.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: Jail starts but doesn't start X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 10:40:56 -0000 On Wed, May 04, 2011 at 04:24:11PM -0700, Mickey Harvey wrote: > Hosts /etc/rc.conf > > 1. ifconfig_bge0="inet 192.168.224.11 netmask 255.255.255.0" > 2. defaultrouter="192.168.224.1" > 3. sshd_enable="YES" > 4. > 5. linux_enable="YES" > 6. zfs_enable="YES" > 7. jail_enable="YES" > 8. jail_list="www0 dns0 smarty0 centos" > 9. > 10. ifconfig_bge0_alias0="inet 192.168.224.12 netmask 255.255.255.255" > 11. jail_www0_rootdir="/tank/jails/www0" > 12. jail_www0_hostname="www0" > 13. jail_www0_ip="192.168.224.12" > 14. jail_www0_devfs_enable="YES" > 15. jail_www0_exec_stop="/etc/rc.shutdown" > 16. > 17. #JAIL READY TO USE, JUST NEEDS APPROPRIATE FSTAB ENTRIES > 18. #ENTRIES ARE IN LOADER.CONF > 19. #TRIED TO BOOT WITH REQUIRED FSTAB BUT IT BROKE SO I REVERTED > 20. #5/3/11 MH > 21. #ifconfig_bge0_alias1="inet 192.168.224.13 netmask 255.255.255.255" > 22. #jail_deb0_rootdir="/tank/jails/deb0" > 23. #jail_deb0_hostname="deb0" > 24. #jail_deb0_ip="192.168.224.13" > 25. #jail_deb0_devfs_enable="YES" > 26. #jail_deb0_exec_start="/etc/init.d/rc 3" > 27. #jail_deb0_exec_stop="/etc/init.d/rc 0" > 28. #jail_deb0_flags="-l -u root" > 29. > 30. ifconfig_bge0_alias1="inet 192.168.224.14 netmask 255.255.255.255" > 31. jail_dns0_rootdir="/tank/jails/dns0" > 32. jail_dns0_hostname="dns0" > 33. jail_dns0_ip="192.168.224.14" > 34. jail_dns0_devfs_enable="YES" > 35. jail_dns0_exec_stop="/etc/rc.shutdown" > 36. > 37. ifconfig_bge0_alias2="inet 192.168.224.15 netmask 255.255.255.255" > 38. jail_smarty0_rootdir="/tank/jails/smarty0" > 39. jail_smarty0_hostname="smarty0" > 40. jail_smarty0_ip="192.168.224.15" > 41. jail_smarty0_devfs_enable="YES" > 42. jail_smarty0_exec_stop="/etc/rc.shutdown" > 43. > 44. ifconfig_bge0_alias3="inet 192.168.224.16 netmask 255.255.255.255" > 45. jail_centos_rootdir="/tank/jails/centos" > 46. jail_centos_hostname="centos" > 47. jail_centos_ip="192.168.224.16" > 48. jail_centos_devfs_enable="YES" > > > Result of jls after /etc/rc.d/jail start centos (notice there's no entry for > centos) > > JID IP Address Hostname Path > 1 192.168.224.12 www0 /tank/jails/www0 > 2 192.168.224.14 dns0 /tank/jails/dns0 > 3 192.168.224.15 smarty0 /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 keep it up. By default, jails started thru rc.d/jail are not persistent. Try adding something like cron_enable="YES" to rc.conf inside the jail. Regards, Paul Schenkeveld