ezjail
obr
obr at sosgastro.cz
Thu Mar 30 10:32:17 CEST 2006
Dobry den,
mam v planu realizovat jaily a tak se zbavit nekolika starych stroju....
Pri cteni dokumentace na rootu, onlamp.com, handbooku atd... jsem se seznamil s technikou sestavovani jailu.
Narazil jsem take na port ezjail, ktery velmi usnadni prai pri sestavovani a udrzbe nekolika jailu najednou.
Po zadani ezjail_enable="YES" v rc.conf by mel spustit po startu systemu vsechny jaily vytvorene pomoci ezjail-admin. Pro spusteni pouziva skript /usr/local/etc/rc.d/ezjail.sh
Problem je v tom, ze mi je nespusti....
Prikaz jls po startu ukazuje, ze zadny jail nebezi.
Pokud spustim skript "rucne" - /usr/local/etc/rc.d/ezjail.sh start - jaily se spusti a jls ukazuje spustene jaily...no a vsechno krasne funguje.
*************************************************************************************
skript ezjail.sh:
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ezjail
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable ezjail
#
#ezjail_enable="YES"
#
# Please do not change this file, configure in /usr/local/etc/ezjail.conf
# ugly: this variable is set on port install time
ezjail_prefix=/usr/local
. /etc/rc.subr
name=ezjail
rcvar=`set_rcvar`
load_rc_config ${name}
ezjail_enable=${ezjail_enable:-"NO"}
restart_cmd="do_cmd restart _"
start_cmd="do_cmd start '_ ezjail'"
stop_cmd="do_cmd stop '_ ezjail'"
do_cmd()
{
action=$1; message=$2; shift 2;
ezjail_list=
[ -n "$*" ] && ezjail_list=`echo -n $* | tr -c "[:alnum:] " _` || echo -n "${message##_}"
ezjail_list=${ezjail_list:-`ls ${ezjail_prefix}/etc/ezjail/`}
ezjail_pass=
for ezjail in ${ezjail_list}; do
if [ -f ${ezjail_prefix}/etc/ezjail/${ezjail} ]; then
. ${ezjail_prefix}/etc/ezjail/${ezjail}
ezjail_pass="${ezjail_pass} ${ezjail}"
else
echo " Warning: Jail ${ezjail} not found."
fi
done
[ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action} ${ezjail_pass}
}
run_rc_command $*
*************************************************************************************
Zde si nacte ezjail.sh konfiguraci:
soubor /usr/local/etc/ezjail/jail.xxx.yyy.cz
export jail_bakalari_earth_sosgastro_cz_hostname="jail.xxx.yyy.cz"
export jail_bakalari_earth_sosgastro_cz_ip="192.168.3.12"
export jail_bakalari_earth_sosgastro_cz_rootdir="/usr/jails/jail.xxx.yyy.cz"
export jail_bakalari_earth_sosgastro_cz_exec="/bin/sh /etc/rc"
export jail_bakalari_earth_sosgastro_cz_mount_enable="YES"
export jail_bakalari_earth_sosgastro_cz_devfs_enable="YES"
export jail_bakalari_earth_sosgastro_cz_devfs_ruleset="devfsrules_jail"
export jail_bakalari_earth_sosgastro_cz_procfs_enable="YES"
export jail_bakalari_earth_sosgastro_cz_fdescfs_enable="YES"
*************************************************************************************
fstab pro pripojeni tzv "basejailu" se sdileny soubory pro kazdy jail:
soubor fstab.jail_xxx_yyy_cz
/usr/jails/basejail /usr/jails/jail.xxx.yyy.cz/basejail nullfs ro 0 0
*************************************************************************************
rc.conf:
# -- sysinstall generated deltas -- # Fri Feb 17 17:18:43 2006
defaultrouter="192.168.3.1"
hostname="xxx.yyy.zzzz.cz"
ifconfig_bge0="inet 192.168.3.11 netmask 255.255.255.0"
ifconfig_bge0_alias0="inet 192.168.3.12 netmask 255.255.255.255"
ifconfig_bge0_alias1="inet 192.168.3.13 netmask 255.255.255.255"
ntpdate_enable="YES"
ntpdate_flags="ntp.karpo.cz"
sendmail_enable="NONE"
sshd_enable="YES"
usbd_enable="NO"
saver="blank"
blanktime="300"
sendmail_enable="NONE"
#Syslog posloucha jen na teto adrese
syslogd_flags="-b 192.168.3.11"
#inetd_flags="-wW -C 60 -a 192.168.3.11"
#MYSQL
mysql_enable="YES"
mysql_dbdir="/usr/local/var/db/mysql"
#Apache
apache_enable="YES"
#Linux support
linux_enable="YES"
#ezjail
ezjail_enable="YES"
Nevite, v cem by mohla byt chyba? Kde a jak chybu hledat, tak, aby ezjail.sh vse po startu systemu spustil?
Diky za alespon nasmerovani.....
Pavel
More information about the Users-l
mailing list