Login    Register

Jail problems

Compile and development by yourself!
Forum rules
Set-Up GuideFAQsForum Rules
  • Author
    Message

Jail problems

Postby alexey123 » 04 Sep 2012 08:49

I try to use jail first time.
When I begin to start jail in Nas4free server I find wiki page about it
I build my jail step-by-step as wiki, I replace IP only.
In first
script jail_start with error
#!/bin/tcsh -x
#mounting to /jail
mkdir /jail
mount_nullfs /mnt/jail /jail <------ Error here, must be for this building mount_nullfs /mnt/data/jail /jail
# copy jail binaries to /usr
cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
#start all jails
/etc/rc.d/jail start


My building
Host_for test - working machine x86-embedded on AMD Sempron(tm) 2200+ , 9.1.0.1 - Sandstorm (revision 262)
I add jail folder from another host over NFS, because I don't have space on my testing mashine. Jail folder mount to /mnt/data/jail.

My startup script
Code: Select all
#!/bin/tcsh -x
#mount nfs
mount -t nfs 10.0.0.1:/mnt/disk/freebsd/jail /mnt/data/jail
#mounting to /jail
mkdir /jail
mount_nullfs /mnt/data/jail /jail
# copy jail binaries to /usr
cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
#start all jails
/etc/rc.d/jail start


My problem: Jail started, but not have access to and from internet.
when I execute ifconfig, I don't see IP adress.
Code: Select all
 root@proto:/ # ifconfig
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:11:5b:7f:29:cf
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
ipfw0: flags=8801<UP,SIMPLEX,MULTICAST> metric 0 mtu 65536
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>


Also when I run #/etc/rc.d/jail start , nas4free answer is
Configuring jails:.
proto.domain.local.


Anybody can help me ?
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby alexey123 » 04 Sep 2012 09:14

Just reebot host 2-3 times.. It begin execute portsnap fetch update.
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby alexey123 » 05 Sep 2012 07:28

I can not create user for jail from command line.
Building says
Code: Select all
pwd_mkdb: flock: Operation not supported
pw: passwd file update: Inappropriate ioctl for device
adduser: ERROR: There was an error adding user (minecraft).
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby raulfg3 » 05 Sep 2012 07:56

Site Admin
raulfg3

User avatar
 
Posts: 3723
Joined: 22 Jun 2012 20:13
Location: Madrid (ESPAÑA)

Re: Jail problems

Postby alexey123 » 05 Sep 2012 08:23

Thank you.
This is first my jail, I need study it. Also I help to attach minecraft server for peetbul.
Now I find error in nas4free wiki and one "not clean" work. I think, jail must be create into memory device:
1. create file for jail with dd comand and properly size, for example (for 9.5GB size)
Code: Select all
dd if=/dev/zero of=/path/to/jail/proto/image/jail.bin bs=1M count=10000

2. Attach it with mdconfig command
Code: Select all
mdconfig -a -t vnode -f /path/to/jail/proto/image/jail.bin -u 10

3. Format and label it.
4. Mount it and create jail inside a file.
===============
Now my success steps is - run jail, add port collection and sources, install Java into jail.
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby alexey123 » 07 Sep 2012 11:35

OK, I continue. I rebuilt nas4free test machine and replace x86-full on AMD Sempron(tm) 2200+ with 512M ram on x64-embedded on AMD E-350 with 2G ram.
But small trouble - I haven't hard disk, but I built new noob - idea.
I built two iSCSI target on my working FreeNAS 7.5 for /mnt/data partition and /jail for minecraft.

Image

For this work, I create folder /cf/script and create 3 files
1. File /cf/script/startup.sh. This file I create as executable, and run is as postinit script
Code: Select all
#!/bin/bash
# Load iSCSI client
kldload /boot/kernel/iscsi_initiator.ko
# Add data disk to install packages on embedded version
iscontrol -c /cf/script/iscsi.conf -n idisk1
sleep 5
mkdir /mnt/data
mount /dev/da1p1 /mnt/data
mount_unionfs /mnt/data/opt/usr_local /usr/local
mount_unionfs /mnt/data/opt/var /var
iscontrol -c /cf/script/iscsi_jail.conf -n idisk1
sleep 5
mkdir /jail
mount /dev/da2p1 /jail
# copy jail binaries to /usr
cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
#start all jails
/etc/rc.d/jail start


2 File /cf/script/iscsi.conf
Code: Select all
idisk1 {
    authmethod      = NONE
    initiatorname   = iqn.2005-01.il.ac.huji.cs::nas4free.local
    TargetName      = iqn.2007-09.co.il.p.aganim:nas4free.data
    TargetAddress   = 10.0.0.1:3260,1
}


3. File /cf/script/iscsi_jail.conf
Code: Select all
idisk1 {
    authmethod      = NONE
    initiatorname   = iqn.2005-01.il.ac.huji.cs::nas4free.local
    TargetName      = iqn.2007-09.co.il.p.aganim:nas4free
    TargetAddress   = 10.0.0.1:3260,1
}


This building work, but minecraft not work under FReeBSD-9 if I use the base scheme for FreeNAS .
I continue..
Last edited by alexey123 on 07 Sep 2012 20:04, edited 1 time in total.
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby alexey123 » 07 Sep 2012 14:12

Yes! It work
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Re: Jail problems

Postby alexey123 » 13 Sep 2012 08:45

Ok, I try compile under jail BSDMC.
In first - processes under jail must be run from host root. If start process from proto root, files for word, compiled from source have flags unchange, and proto's root can't copy or remove its.
Code: Select all
chroot /jail/proto
...
But it not help me.. :cry:
Log
+ add_port_x11_xorg-minimal
+ [ ! -d /usr/obj/BSDMC.amd64/ports ]
+ mkdir -p /usr/obj/BSDMC.amd64/ports/packages
+ mkdir -p /usr/obj/BSDMC.amd64/_.w/usr/ports/packages
+ mount -t unionfs -o noatime /usr/bsdmc/BSDMC/FreeBSD/src /usr/obj/BSDMC.amd64/_.w/usr/src
mount_unionfs: /usr/obj/BSDMC.amd64/_.w/usr/src: : Operation not supported by device


I begin check
Code: Select all
chroot /jail/proto
mkdir one two
mount_unionfs one two

NOT WORKING :cry:
Lab 9.1.0.1 - Sandstorm (revision 847) / x86-embedded on HP D530 / 2G RAM / CF IDE as system
Home9.2.0.1 - Sandstorm (revision 943) / x64-embedded on SAPPHIRE Pure Mini E350 / 4G RAM
Moderator
alexey123

User avatar
 
Posts: 1295
Joined: 19 Aug 2012 06:22
Location: Israel

Return to Development & Developers

Who is online

Users browsing this forum: No registered users and 0 guests