From owner-freebsd-questions@FreeBSD.ORG Sun Nov 17 14:57:19 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFB8CD6 for ; Sun, 17 Nov 2013 14:57:18 +0000 (UTC) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F82121AB for ; Sun, 17 Nov 2013 14:57:17 +0000 (UTC) Received: from [192.168.1.35] (host86-150-247-154.range86-150.btcentralplus.com [86.150.247.154]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id rAHEvFoi062656 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO) for ; Sun, 17 Nov 2013 14:57:16 GMT (envelope-from frank2@fjl.co.uk) Message-ID: <5288D94B.9090301@fjl.co.uk> Date: Sun, 17 Nov 2013 14:57:15 +0000 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Installing Java without enter FreeBSD Jail References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.16 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Nov 2013 14:57:19 -0000 On 16/11/2013 19:17, Hung Son Nguyen wrote: > Hi, > > I plan to write a script that automatically create FreeBSD Jail with Java > installed. But I have problem when installing java. As I found on the > internet, I have to install java using port collection, but how can I use > port collection to install software without enter the Jail? > Do we have another way to install java on FreeBSD? > > Many thanks, First of all, you can install ports in a jail. You either copy the ports directory there, map the ports directory using mount_nullfs, to save disk space. This can either be r/w (but make sure only one instance is building at a time) or you can mount it r/o, and use the variables WRKDIRPREFIX, DISTDIR and PACKAGES to redirect the build mechanism to a r/w area inside the jail. You can set these conveniently in /etc/make.conf. If you leave distfiles r/o and make sure everything is already there then there is no need for each jail to download its own copy. If you want to make distillates r/w and you've mounted ports are r/o you CAN mount a r/w distfiles directory over the r/o one. e.g.: mount_nullfs -o ro /usr/ports /data/jail1/usr/ports mount_nullfs -o rw /usr/ports/distfiles /data/jail1/usr/distfiles Or better,optionally copy teh distfiles in to /data/jail1/var... and in /data/jail1/etc/make.conf, add: DISTDIR= /var/ports/distfiles Secondly, there is more than one version of Java. The "old" one required several manual steps to overcome licensing restrictions - see /usr/ports/java/diablo-jdk16. The latest releases have OpenJDK instead - /usr/ports/java/openjdk7 Java seems to need to compile every open-source package on the planet before it will build and install, so it could be easier to build it, and its dependencies, once and copy the resulting binaries directly in to every jail. Alternatively, compile the port and its dependencies and selectively copy the bits in /usr/ports that change in to every jail - then do the make install from the jail. You do not need to go through all the buildworld stuff to create a jail. You can just copy the files from an installation in to the jail directory, as long as they are compatible with the kernel you're using. Regards, Frank.