Page 1 of 1

New to jails, need to perform stripdown?

Posted: 18 Jan 2013 00:54
by pompelogpilt
Hi
I wanna try the serviio jail install, so i followed the initial guide for installing jails -> http://wiki.nas4free.org/doku.php?id=do ... owto:jails
Everything works fine except for the buildworld command, i keep getting errors in this after only a few minutes.
Is it important to do this part? From what i understood in the tutorial this is more to make the jail smaller? Can i just use the jail as it is without stripping it down and customizing it??

And a folder that have been created when i tryed to use the make installworld command is impossible to delete?
I´ve tryed lots of solutions found online, but nothing helps.. Its owned by root and the wheel group, but even as root i cant delete it!

Code: Select all

yggdrasil:/mnt/Pool/jail/serviio/var# ls -l
total 2
dr-xr-xr-x  2 root  wheel  2 Jan 17 23:41 empty

i cant change any permissions, everything is denied..

Code: Select all

yggdrasil:/mnt/Pool/jail/serviio/var# ls
empty
yggdrasil:/mnt/Pool/jail/serviio/var# chmod -R u+w empty
chmod: empty: Operation not permitted
All this is done as root..

Any suggestions on this will be greatly appreciated!

K

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 01:32
by pompelogpilt
found a solution for the undeletable folders,

Code: Select all

chflags -R noschg "DIRECTORY_NAME"
rm -rf "DIRECTORY_NAME"
Of course i had to use freebsd code, not unix code...

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 09:01
by raulfg3
pompelogpilt wrote:Everything works fine except for the buildworld command
not needed to install buildworld, in fact you need to stop once jail proto is working and you can do a jls and a reboot and your jail work as expected.

PD: I suggest when you have this first working jail that create a second one named serviio.

once you are in shell:

ls -l to be sure you ar in /jail.

Code: Select all

mkdir serviio
tar xvf /jail/work/base.txz -C /jail/serviio/
tar xvf /jail/work/lib32.txz -C /jail/serviio/
cp /etc/resolv.conf /jail/serviio/etc/
cp /jail/serviio/usr/share/zoneinfo/Europe/Madrid /jail/serviio/etc/localtime  # Replace Madrid by your local time zone
touch /jail/conf/fstab.serviio   # edit file using ee editor to desired value

done, you only need to edit /jailconf/rc.conf.local I use Nas4Free embeded file editor for comodity and add needed files eg:
### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
jail_enable="YES" # enable jails YES|NO
jail_list="proto serviio" # name of the jails to start "proto http://www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.domain.local" # hostname
jail_proto_ip="192.168.1.201" # ip of the jail
jail_proto_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
#
jail_serviio_rootdir="/jail/serviio" # path to our jail
jail_serviio_hostname="serviio" # hostname
jail_serviio_ip="192.168.1.202" # ip of the jail
jail_serviio_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_serviio_devfs_enable="YES" # use devfs
jail_serviio_mount_enable="YES" # mount YES|NO
jail_serviio_fstab="/jail/conf/fstab.serviio" # File with Filesystems to mount
once saved you can test that new jail start:

Code: Select all

/etc/rc.d/jail start serviio

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 09:06
by raulfg3
pompelogpilt wrote:found a solution for the undeletable folders,

Code: Select all

chflags -R noschg "DIRECTORY_NAME"
rm -rf "DIRECTORY_NAME"
Of course i had to use freebsd code, not unix code...

sollution in last lines of wiki jails.

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 11:42
by thermion
.......not needed to install buildworld, in fact you need to stop once jail proto is working ...........
PD: I suggest when you have this first working jail that create a second one named serviio.
Thanks Raul, that is helpful. I have just got to the same point, and was trying to decide best way from here.

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 14:08
by pompelogpilt
thank you for your quick answers!
what is the purpose of the buildworld if it isnt needed?

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 14:55
by raulfg3
pompelogpilt wrote:thank you for your quick answers!
what is the purpose of the buildworld if it isnt needed?
Is needed if you want to install a new jail that use less space in Disk (usefull for some install).

The purpouse is the same that all in the jail wiki, learn how to do things , and that you can do things in differents ways or ussing diferrents aproachs, but you need to understand what you do, to avoid problems of copy/paste without think what you do.

Re: New to jails, need to perform stripdown?

Posted: 18 Jan 2013 19:13
by fsbruva
The Jail wiki wrote:Our current jail ( proto ) includes many applications from the FreeBSD base system. Many of them we don't need inside a jail.

Re: New to jails, need to perform stripdown?

Posted: 19 Jan 2013 13:40
by pompelogpilt
Thank u for all your help! Much appreciated :-)

Re: New to jails, need to perform stripdown?

Posted: 28 Mar 2013 03:45
by DrMule
Beware typo in example /jailconf/rc.conf.local last line:

Code: Select all

jail_seriio_fstab="/jail/conf/fstab.serviio"	# File with Filesystems to mount
should read:

Code: Select all

jail_serviio_fstab="/jail/conf/fstab.serviio"	# File with Filesystems to mount
(Missing 'v')

Took me an hour this evening to discover after blindly cutting and pasting.

Re: New to jails, need to perform stripdown?

Posted: 28 Mar 2013 10:42
by raulfg3
Thanks, corrected.