Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2002 13:08:04 +0300
From:      "Victor Polyakov" <victor@tvcom.ru>
To:        <freebsd-hackers@freebsd.org>
Subject:   jail + mount_union problem
Message-ID:  <002601c1d3e4$f448cae0$6b40f650@niokr2>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0023_01C1D3FE.1938EEC0
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: quoted-printable


    We have a system with some jails. First jail's home directory is =
/data/jails/ref. Then, we are running script "crash" under root:

-----------

#! /usr/local/bin/bash

SRC=3D/data/jails/ref
DEST=3D/data/jails/$1

mkdir $DEST

mkdir $DEST/usr
mount_union -b $SRC/usr $DEST/usr

mkdir $DEST/bin
mount_union -b $SRC/bin $DEST/bin

mkdir $DEST/root
mount_union -b $SRC/root $DEST/root

jail /data/jails/$1 jail$1 $2 /bin/csh /root/scripts/runjail

mount_union -b $SRC/usr $DEST/usr

mount_union -b $SRC/bin $DEST/bin

mount_union -b $SRC/root $DEST/root

--------------

Originally, this script was designed to make a clone of the first jail. =
Contents of /root/scripts/runjail:

-------------

sshd
/usr/local/apache/bin/apachectl start
cd /usr/local/mysql
bin/safe_mysqld --user=3Dmysql &
cron

-------------

After this, system hangs up. When trying to reboot with "boot -sv" we =
see:

...
...
trying /sbin/init...

and freebsd halts again. There is no way to boot up. Of course, fsck =
reports "no problem" and checksum of /sbin/init is correct. The only way =
to continue working is to run "upgrade" from the instalation CD.

We are using freebsd 4.5.

May be anybody knows solution for this problem?

Victor Polyakov (victor@tvcom.ru)


------=_NextPart_000_0023_01C1D3FE.1938EEC0
Content-Type: text/html;
	charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dkoi8-r">
<META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; We have a system =
with some=20
jails. First jail's home directory is /data/jails/ref. Then, we are =
running=20
script "crash" under root:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-----------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#! /usr/local/bin/bash</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>SRC=3D/data/jails/ref<BR>DEST=3D/data/jails/$1<BR></FONT><FONT =
face=3DArial=20
size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>mkdir $DEST</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mkdir $DEST/usr<BR>mount_union -b =
$SRC/usr=20
$DEST/usr</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mkdir $DEST/bin<BR>mount_union -b =
$SRC/bin=20
$DEST/bin</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mkdir $DEST/root<BR>mount_union -b =
$SRC/root=20
$DEST/root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>jail /data/jails/$1 jail$1 $2 /bin/csh=20
/root/scripts/runjail</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mount_union -b $SRC/usr =
$DEST/usr</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mount_union -b $SRC/bin =
$DEST/bin</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mount_union -b $SRC/root=20
$DEST/root<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>--------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Originally, this script was designed to =
make a=20
clone of the first jail. Contents of /root/scripts/runjail:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>sshd<BR>/usr/local/apache/bin/apachectl =
start<BR>cd=20
/usr/local/mysql<BR>bin/safe_mysqld --user=3Dmysql =
&amp;<BR>cron</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>After this, system hangs up. When =
trying to reboot=20
with "boot -sv" we&nbsp;see:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>trying /sbin/init...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and freebsd halts again. There is no =
way to boot=20
up. Of course, fsck&nbsp;reports "no problem" and checksum of /sbin/init =
is=20
correct. The only way to&nbsp;continue working is to&nbsp;run=20
"upgrade"&nbsp;from the instalation CD.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>We are using freebsd 4.5.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be anybody knows solution for this=20
problem?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Victor Polyakov (<A=20
href=3D"mailto:victor@tvcom.ru">victor@tvcom.ru</A>)</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0023_01C1D3FE.1938EEC0--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002601c1d3e4$f448cae0$6b40f650>