作業日記@HatenaBlog

各種の作業メモ

ezjailを構築

ezjailをインストール

# portinstall -v sysutils/ezjail

設定ファイルをコピー

# cd /usr/local/etc/
# cp -p ezjail.conf.sample ezjail.conf

設定ファイルの記述

旧サーバのjailディレクトリが /jail であるので、設定ファイルを次のように記述する。
赤い # コメントアウトの削除を意味する。

# ezjail.conf - Example file, see ezjail.conf(5)
#
# Note: If you alter some of those variables AFTER creating your first
# jail, you may have to adapt /etc/fstab.* and EZJAIL_PREFIX/etc/ezjail/* by
# hand

# Location of jail root directories
#
# Note: If you have spread your jails to multiple locations, use softlinks
# to collect them in this directory
# ezjail_jaildir=/usr/jails
ezjail_jaildir=/jail

# Location of the tiny skeleton jail template
# ezjail_jailtemplate=${ezjail_jaildir}/newjail

# Location of the huge base jail
# ezjail_jailbase=${ezjail_jaildir}/basejail

# Location of your copy of FreeBSD's source tree
# ezjail_sourcetree=/usr/src

# In case you want to provide a copy of ports tree in base jail, set this to
# a cvsroot near you
# ezjail_portscvsroot=freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs

# This is where the install sub command defaults to fetch its packages from
# ezjail_ftphost=ftp.freebsd.org

# This is the command that is being executed by the console subcommand
# ezjail_default_execute=/usr/bin/login -f root

# This is the default location where ezjail archives its jails to
# ezjail_archivedir=`pwd -P`

# base jail will provide a soft link from /usr/bin/perl to /usr/local/bin/perl
# to accomodate all scripts using '#!/usr/bin/perl'...
# ezjail_uglyperlhack="YES"

# Default options for newly created jails
#
# Note: Be VERY careful about disabling ezjail_mount_enable. Mounting
# basejail via nullfs depends on this. You will have to find other
# ways to provide your jail with essential system files
# ezjail_mount_enable="YES"
# ezjail_devfs_enable="YES"
# ezjail_devfs_ruleset="devfsrules_jail"
# ezjail_procfs_enable="YES"
# ezjail_fdescfs_enable="YES"

ベースシステムの構築

# ezjail-admin update

構築しようとしたが最小インストールのためソースが無く、構築に失敗した。
sysintallコマンドで Kern-Developer からソース、ドキュメントを全てインストールした。
ソースだけを入れるつもりが / を上書きしてしまい環境が壊れた。
最初からインストールし直すことにする。