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

[-- Attachment #1 --]

    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=/data/jails/ref
DEST=/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=mysql &
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)


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

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