PDA

View Full Version : Problem setting up jails


myha
December 11th, 2008, 09:14
Hi,

I need some help in setting up jails...

I am following the handbook (http://www.freebsd.org/doc/en/books/handbook/jails-application.html), but I get an error right at the beginning...


[root@polmer1 /usr/src]# make installworld DESTDIR=/home/j/mroot
mkdir -p /tmp/install.K2VrrZ4s
for prog in [ awk cap_mkdb cat chflags chmod chown date echo egrep find grep install-info ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl test true uname wc zic; do cp `which $prog` /tmp/install.K2VrrZ4s; done
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=i386 MACHINE=i386 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/tmp/install.K2VrrZ4s make -f Makefile.inc1 reinstall
--------------------------------------------------------------
>>> Making hierarchy
--------------------------------------------------------------
cd /usr/src; make -f Makefile.inc1 hierarchy
cd /usr/src/etc; make distrib-dirs
cd: can't cd to /usr/src/etc
*** Error code 2

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
[root@polmer1 /usr/src]#


I guess I am missing something....?

thanks,
brm

SirDice
December 11th, 2008, 09:38
I guess I am missing something....?
Yes, a complete source tree. Try csup to update the source. If it is up2date did you make buildworld first?

Ole
December 11th, 2008, 09:38
Do you cvsuped before and buildworld finish accomplish without errors ?

myha
December 11th, 2008, 10:16
Hi,

the csup is done and all the packages are updated without errors.

I have tried the make buildworld also but I get the following errer:
[root@polmer1 /usr/src]# make buildworld
cd: can't cd to /usr/src/tools/build/make_check

--------------------------------------------------------------
>>> Building an up-to-date make(1)
--------------------------------------------------------------
cd: can't cd to /usr/src/usr.bin/make
*** Error code 2

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
[root@polmer1 /usr/src]#

Ole
December 11th, 2008, 11:00
Can you public config file which you execute csup ?
Also show:

uname -a

and

du -sh /usr/src

myha
December 11th, 2008, 11:56
Here you go:

[root@polmer1 ~]# uname -a
FreeBSD polmer1.domena 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Tue Dec 9 18:25:35 CET 2008 root@polmer1.domena:/usr/obj/usr/src/sys/MYKERNEL i386
[root@polmer1 ~]# du -sh /usr/src
121M /usr/src
[root@polmer1 ~]#

root@polmer1 ~]# cat ports-supfile
# $FreeBSD: src/share/examples/cvsup/ports-supfile,v 1.38 2007/09/07 22:01:19 gabor Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-current ports collection.
#
# CVSup (CVS Update Protocol) allows you to download the latest CVS
# tree (or any branch of development therefrom) to your system easily
# and efficiently (far more so than with sup, which CVSup is aimed
# at replacing). If you're running CVSup interactively, and are
# currently using an X display server, you should run CVSup as follows
# to keep your CVS tree up-to-date:
#
# cvsup ports-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
# cvsup -g -L 2 ports-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=CHANGE_THIS.FreeBSD.org
# This specifies the server host which will supply the
# file updates. You must change it to one of the CVSup
# mirror sites listed in the FreeBSD Handbook at
# http://www.freebsd.org/doc/handbook/mirrors.html.
# You can override this setting on the command line
# with cvsup's "-h host" option.
#
# base=/var/db
# This specifies the root where CVSup will store information
# about the collections you have transferred to your system.
# A setting of "/var/db" will generate this information in
# /var/db/sup. You can override the "base" setting on the
# command line with cvsup's "-b base" option. This directory
# must exist in order to run CVSup.
#
# prefix=/usr
# This specifies where to place the requested files. A
# setting of "/usr" will place all of the files requested
# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
# The prefix directory must exist in order to run CVSup.

# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.si.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line. (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress

## Ports Collection.
#
# The easiest way to get the ports tree is to use the "ports-all"
# mega-collection. It includes all of the individual "ports-*"
# collections,
#ports-all

# These are the individual collections that make up "ports-all". If you
# use these, be sure to comment out "ports-all" above.
#
# Be sure to ALWAYS cvsup the ports-base collection if you use any of the
# other individual collections below. ports-base is a mandatory collection
# for the ports collection, and your ports may not build correctly if it
# is not kept up to date.
ports-base
ports-accessibility
#ports-arabic
ports-archivers
ports-astro
#ports-audio
#ports-benchmarks
#ports-biology
#ports-cad
#ports-chinese
#ports-comms
#ports-converters
ports-databases
ports-deskutils
ports-devel
ports-dns
ports-editors
ports-emulators
#ports-finance
#ports-french
ports-ftp
#ports-games
#ports-german
ports-graphics
#ports-hebrew
#ports-hungarian
#ports-irc
#ports-japanese
ports-java
#ports-korean
ports-lang
#ports-mail
#ports-math
#ports-mbone
ports-misc
#ports-multimedia
ports-net
#ports-net-im
ports-net-mgmt
#ports-net-p2p
#ports-news
#ports-palm
#ports-polish
ports-ports-mgmt
#ports-portuguese
#ports-print
#ports-russian
#ports-science
ports-security
ports-shells
ports-sysutils
ports-textproc
#ports-ukrainian
#ports-vietnamese
ports-www
#ports-x11
#ports-x11-clocks
#ports-x11-drivers
#ports-x11-fm
#ports-x11-fonts
#ports-x11-servers
#ports-x11-themes
#ports-x11-toolkits
#ports-x11-wm

Ole
December 11th, 2008, 12:13
wow, follow config for cvsup will upgrade you /usr/ports directory only.
For /usr/src you must use stable-supfile file:

grep -v "^#" /usr/share/examples/cvsup/stable-supfile


*default host=CHANGE_THIS.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_7
*default delete use-rel-suffix

*default compress

src-all


try set
*default host=CHANGE_THIS.FreeBSD.org to

*default host=cvsup.si.FreeBSD.org

(or other listen in http://www.freebsd.org/doc/handbook/mirrors.html)
and

*default release=cvs tag=RELENG_7_0

if you wish to take 7.0-STABLE.

Than csup -g -z stable-supfile and make buildworld

Ole
December 11th, 2008, 12:21
BTW


[root@polmer1 ~]# du -sh /usr/src
121M /usr/src


Looks like you have only /usr/src/sys, without userland stuff
(My 7.1-PRE /usr/src/sys is 126M)

So, with csup you must be ready for receive ~350Mb (compress options of course save you) of internet traffic (Full /usr/src tree for 7.1-PRERELEASE is 492M)

myha
December 11th, 2008, 14:33
Hi,

well, this looks better now :) I simply followed the handbook under which you apparently just enable the ports.

Thanks for your support, I hope it will go from here on. I am completely new to FreeBSD so this BSD specific stuff is still a bit confusing to me, but I am getting there :)

Thanks,
brm

myha
December 11th, 2008, 15:07
Just one more question - I must upgrade all the supfiles (ports-supfile, stable-supfile) to have all ports available?

Ole
December 11th, 2008, 20:00
"/usr/src" and "/usr/ports" are not connected in any way among themselves and for work of everyone presence of another is not required.
"/usr/src" it is used for building FreeBSD OS base, while /usr/ports - for building ported soft which is not base system.

SirDice
December 11th, 2008, 20:09
*default release=cvs tag=RELENG_7_0

if you wish to take 7.0-STABLE.
RELENG_7_0 will get you 7.0-RELEASE + security updates. If you want 7-STABLE use RELENG_7 (which currently is 7.1-PRERELEASE).

Ole
December 11th, 2008, 20:16
Of cource, thanks for fix!

robertclemens
December 17th, 2008, 08:01
Myha:

Just wanted to toss out a side suggestion of playing with a script set called "ezjail". Google it and it makes running jails soooooo easy. You
barely have any setup to do and it handles updating the src files from
the core host install easily for ya.

myha
December 17th, 2008, 09:39
Hi,

yes, I came up with it few days ago and I am really happy with it, it work perfect. Thanks for info anyway :)

Does anyone know if it will be possible in the future to limit system resources per jail?

Thanks,
brm