*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[HOWTO] Install TheBrig - one Jail manager for N4F

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

[HOWTO] Install TheBrig - one Jail manager for N4F

#1

Post by raulfg3 » 15 May 2013 19:57

TheBrig: default jail manager for Nas4Free for full or embeded install.

UPDATE 2016-11-11 Please install first OBI and then install TheBrig from OBI GUI.





1: I'm not the developer of TheBrig, this excelent piece of software is created by fsbruva , you can see his develop in github
2: TheBrig is at the time of this post in beta stage, need some code debug and some improvements but if you install, works fine, actually you can manage jails in a webGUI enviroment, and it's designed to works with Nas4Free in mind, so integration and minimun afection to N4F core is his goal.

Like a jail manager, you can easyly create jails, delete jails, stop working jails , and start a stoped jail, you can also do a backup of your jail config to restore it in case of a new reinstall of N4F, and have some advanced features like a tool to convert existing jails to theBrig jail format, and backup entire jails in a compressed tarball.

TheBrig zero tolerance applies to previously established jails
Thebrig alcatraz allow use another jail tools

You need to delete all configs from /etc/rc.conf, from sysctl, from start-up and shutdown - for (wiki-style, freebsd-style) jails.

First you need to decide what is the folder for your jail, I recomend allways in your data disk, because jails survive to nas4Free reinstall ( not only upgrades, reinstall from scratch).

and if you use ZFS, better if you create a dataset named Jail for this pourpouse ( Of course you can create a folder named Jail in every path like you want, but it's easy to have a folder Jail in the root of your pool/ mount ( Jail can work in ZFS or UFS, no problem).

in the next examples /mnt/NAS-A is my ZFS pool, /mnt/NAS-A/Jail is a dataset that I create to store TheBrig & all My Jails:

Remenber to change the commands acording to your Path, Eg; if you have a pool named /mnt/data and you decide install theBrig in a folder named TheBrig, your install path is /mnt/data/TheBrig


You can install TheBrig from command line or from webGUI, if install from WebGUI, go to Advanced|Execute command, and enter this 3 commans one by one:
1-

Code: Select all

fetch -o /tmp/thebrig_install.sh https://github.com/fsbruva/thebrig/raw/working/thebrig_install.sh
2-

Code: Select all

chmod a+x /tmp/thebrig_install.sh
3-

Code: Select all

/bin/sh /tmp/thebrig_install.sh /mnt/NAS-A/Jail 2
note: change /mnt/NAS-A/Jail by your own destination, if your pool is named Data, can be /mnt/Data/Jail


and you see that is good:


Of course you can do the same using shell (use putty to connect by SSH to your NAS to use the Shell):

this is an example of my install from shell:

Code: Select all

Welcome to NAS4Free!
rnas:~# fetch -o /tmp/thebrig_install.sh https://github.com/fsbruva/thebrig/raw/working/thebrig_install.sh
/tmp/thebrig_install.sh                       100% of 2824  B  118 kBps
rnas:~# chmod a+x /tmp/thebrig_install.sh
rnas:~# /bin/sh /tmp/thebrig_install.sh /mnt/NAS-A/Jail 2
Retrieving the most recent version of TheBrig
working.zip                                    100% of  178 kB   46 kBps
Unpacking the tarball...
x README
x conf/
x conf/bin/
x conf/bin/ftp_amd64
x conf/bin/ftp_i386
x conf/bin/thebrig_fetch.sh
x conf/bin/thebrig_start.php
x conf/bin/thebrig_start.sh
x conf/bin/thebrig_stop.sh
x conf/ext/
x conf/ext/thebrig/
x conf/ext/thebrig/extensions_thebrig.php
x conf/ext/thebrig/extensions_thebrig_check.php
x conf/ext/thebrig/extensions_thebrig_config.php
x conf/ext/thebrig/extensions_thebrig_download.php
x conf/ext/thebrig/extensions_thebrig_edit.php
x conf/ext/thebrig/extensions_thebrig_tarballs.php
x conf/ext/thebrig/extensions_thebrig_tools.php
x conf/ext/thebrig/functions.inc
x conf/ext/thebrig/lang.inc
x conf/ext/thebrig/menu.inc
x conf/ext/thebrig/off_small.png
x conf/ext/thebrig/on_small.png
x conf/freebsd-update.conf
x conf/portsnap.conf
x thebrig_install.sh
Renaming 64 bit ftp binary
Congratulations! Refresh to see a new tab under " Extensions"!
rnas:~#
Thats all, , now you need to refresh your Browser to see if the new extension is installed:



TheBrig have backup -restore funcions
5cb7eaf2bf98.png
Push on Export button, and browser will download thebrig config as xml , Usefull send this file to forum if you have troubles with thebrig.
_______________________________________________________________________________________________________________________________________
Edited by alexey123
Thebrig have 3 brances - master, working and my branch for experiments.
Install working branch over ssh or command line
Choice folder, where TheBrig will live. Folder must be placed on mounted disk, not on system disk. For example /mnt/disk/app/thebrig.
I not recomend use data partition of system disk as holding for TheBrig. Why? Because during Nas4Free update sometimes this partition will formated and jails will lost.
Mount point name disk must be valid, folders app and thebrig installer will create itself.
Connect over ssh or choice console menu 6) Shell and type command

Code: Select all

fetch https://raw.github.com/fsbruva/thebrig/working/thebrig_install.sh
When download complete, run extracted script

Code: Select all

sh thebrig_install.sh /mnt/<path>/<to>/<thebrig> 2
Number 2 say for script extract working branch, without number script will extract master branch

Thats all, you can see webgui tab Extension and thebrig drop-down menu

What can do working branch command-line installer? It can automatically upgrade first installed thebrig to new version, need type path to prreviosly installed thebrig.
Path can read into Extensions|TheBrig|Rudimentary Config tab - instalation folder entry. If you will copy-paste from webpage, pls remove last slash

working branch have additional function
1. FreeBSD update. TheBrig can periodically extract FreeBSD update for all jals, jail may be stoped, but thebrig can update it.
2. Portsnap. All jails can use shared ports tree, no need extract ports for each jail
3. TheBrig have log pages, page for thebrig and read /var/log/message log for each jail. Some as NAS4Free main logs.
4. TheBrig have jail prestart command. User can run his script before jail start. Usefull for load additional kernel modules or open devices
5. Jail have fstab editor. just try it
6. Jail root-user can mount jail-friendly filesystems: devfs, procfs, nullfs, zfs datasets.
7. Thebrig may be simple update over command-line script. We prepare update over webgui for next update

The brig con 5 jails.jpg
freeBSD update_2.jpg
FreeBSD Update.jpg
First time the brig.jpg
fetch.jpg
Extensions-TheBrig-Central Ports - 19-05-2013 22.30.jpg
Extensions theBrig.jpg
________________________________________________________________________________________________________________________


FOR 10.2 based NAS4FRee please use install procedure:
Fetch script

Code: Select all

fetch https://raw.githubusercontent.com/fsbruva/thebrig/alcatraz/thebrig_install.sh
then for install

Code: Select all

/bin/sh thebrig_install.sh /mnt/PATH/TO/brig_folder
For update

Code: Select all

/bin/sh thebrig_install.sh
5cb7eaf2bf98.png
You do not have the required permissions to view the files attached to this post.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#2

Post by raulfg3 » 15 May 2013 21:04

Now it's time to configure TheBrig first time:



1 - you need to configure locations for jails , basejails and template, if you leave blank, uses Installation folders for all:

2- You need to push the Query Button to download tarballs:

Oncedone you have apropiate tarball for yours jails:
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#3

Post by raulfg3 » 15 May 2013 21:05

OK, TheBrig is ready to manage jails, now you can create, delete, start and stop jails.

here an example jail for example:



note: You need to know about Slim jails. They save about 300M per jail, and in later releases of TheBrig, it will be easy to keep the basejail up to date with the latest patches.


note2: basejail is used for thin jails and contains about 300M of the common files from the base system that jails don't need to modify. The template jail can be used as a destination for "make buildworld" if you want to make a custom build. Once you have the template jail filled, you can use it as a source to make multiple other jails



you need to enter some values:


note: the IP address cannot be the same as your Nas4Free!!! It also cannot be in the DHCP scope for your network, either.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#4

Post by raulfg3 » 15 May 2013 21:26

some explanations:


jail Number:is the number of the jail, and can not be the same for two jails, if you have only one jail, number must be =1, if you have two jail, one must be =1, and other =2, etc.. number indicate the order in the start process of the jail, so first time you auto start jails, each jail have the number you assing, but if you stop a jail manually, and later start it, this number is increased automatically by jail_start command.


fstab:

Code: Select all

 /mnt/NAS-A/Video /mnt/NAS-A/Jail/kissdx/mnt/Video nullfs ro 0 0
this mean:
/mnt/NAS-A/Video is the folder in your NAS that you want to mount inside your jail.
/mnt/NAS-A/Jail/kissdx/mnt/Video You need to creat folder Video ( or what you want) inside yourjailname/mnt prior to start first time your jail, once mounted , your jail can see a folder named Videos inside /mnt, so you can use to share, etc...
nullfs ro 0 0 you can use ro if you want to mount in read only mode or rw if you want read-write mode


and finally some example of 4 working jails:




If you have this error in your log:

Code: Select all

query_name_response: Multiple (2) responses received for a query on subnet
this is the fix: viewtopic.php?f=21&t=2944&p=20496#p20586


more info:

when you create a new jail you have some options, one really usefull is the ability to use jail name to log (option -n), see the explanation that bring Alexey123: viewtopic.php?f=79&t=4507#p23650

more options here: http://www.freebsd.org/cgi/man.cgi?query=jail&sektion=8
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#5

Post by raulfg3 » 15 May 2013 23:55

some examples, I create a "slim" jail named kissdx, before to install kissdx I want to know how many space use:

Code: Select all

login as: root
root@192.168.1.17's password:
Last login: Wed May 15 21:23:43 2013 from 192.168.1.10
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.  All rights reserved.

Welcome to NAS4Free!
rnas:~# du -csh /mnt/NAS-A/Jail/kissdx
7.3M    /mnt/NAS-A/Jail/kissdx
7.3M    total
rnas:~#
rnas:~# jls
   JID  IP Address      Hostname                      Path
rnas:~# jls
   JID  IP Address      Hostname                      Path
     3  192.168.1.201   kissdx.local                  /mnt/NAS-A/Jail/kissdx
rnas:~# du -csh /mnt/NAS-A/Jail/kissdx
7.2T    /mnt/NAS-A/Jail/kissdx
7.2T    total
rnas:~# du -cshx /mnt/NAS-A/Jail/kissdx
7.3M    /mnt/NAS-A/Jail/kissdx
7.3M    total
rnas:~#
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#6

Post by fsbruva » 16 May 2013 15:15

Thank you, Raul for posting the screenshots as a HOWTO.

As you can read from some other threads, I started working on TheBrig to assist with managing jails from the webgui. My philosophy was similar to that of ezjail - simple to use, and easy to maintain. Forum member Alexey provided a big help with making the status page and a lot of behind the scenes features and bugfixes. THANKS ALEXEY!!!

DISCLAIMER
I am not responsible for you breaking your system using this extension! Using this extensions implies that you will not complain to the Nas4Free developers when your system doesn't work, either. Jails and their associated functionality are not officially sanctioned by the Nas4Free team. Any of the changes that TheBrig performs to your system (including data loss) are your own chosen risk.
END DISCLAIMER

However, as Raul mentioned, this is a safe beta for now. It doesn't break during the tests that we run - but we can't run them all. If you run into trouble, please let me know, and I will see if I can help you.

In the following explanation, I describe a lot of things regarding FreeBSD. This is because these technologies are developed by the FreeBSD developers, and as such, are outside the control of the Nas4Free developers. However, since Nas4Free is built from FreeBSD, all this works on Nas4Free, as well.

Basic Jail Info
In FreeBSD (as well as Linux), there are two main pieces that make up the operating system: the kernel and userland. The kernel is the core of the operating system, and is a specialized program that is customized for the CPU architecture of the computer. The kernel manages all the other programs on the system, as well as manages communication to and from the hardware of the system. In this way, the userland programs only need to know how to speak to the kernel, because the kernel has pre-established methods of performing actions. The userland programs don't have to worry about what kind of video card you have, or the hard drive sector size because the kernel takes care of that.

FreeBSD has a mechanism in the installed operating system's kernel to listen to instructions from a completely separate set of userland programs. The kernel knows that this other userland is of limited privilege, and will not allow it to modify anything on the full operating system. Due to the significant restrictions that the kernel places on this other userland, it was named a "jail." The jail is made up of all the files of a copy of FreeBSD, but shares the kernel with the host operating system. These files are located someplace on the filesystem, say at /mnt/zpool2/jail_1. If you copied a file into that directory, the jail would see it at /, the root of the filesystem. An intelligent user might be able to use some tricks to detect that they were in a jail, but the operating system in the jail doesn't know any different. It has access to a kernel, and has all the files it needs to be an OS. The default setting is that the jail cannot access ANYTHING outside of its home folder, except the kernel. Due to the fact that the jail and the host system have a common kernel, FreeBSD jails are known as para-virtualized operating systems.

You might be asking yourself, "Why would you want this?" There are a few reasons:

Security - The host operating system's files are protected from access by the jail, and any user inside the jail. For this reason, if a jail gets hacked and the hacker obtains root access - they can't do any harm to your main system. This is a HUGE benefit, especially if the jail is accessible from the internet - hackers might stop your media server, but your NAS will be happy as a clam. You can simply shutdown and wipe the jail out and rebuild it from a backup and be up and running in no time!

Compatibility - The host operating system's files in userland do not affect the jail's. For example, if you are running one application on the host that requires Perl 5.12, but you want to install another piece of software that only supports up to Perl 5.8 - you will not be able to. In this case, you create a jail and install Perl 5.8 and your other piece of software in it, and though you have two copies of Perl running, neither of them know that. This is VERY important because if you try to install certain packages to Nas4Free, it can break the software versions.

Ease of Remote Administration - Since the jail's running or not does not affect the host system, it is very easy to restart a jail to complete an installation. If the jail cannot start for some reason - it only affects the jail, rather than your SSH, FTP and other functions your NAS is taking care of on your network.

Flexibility - The jailed copy of FreeBSD is totally oblivious to the underlying operating system. It only really cares about the major version of the kernel it's using. This is a big deal because as you upgrade the host Nas4Free or FreeBSD version, the jail just keeps on trucking - even on an embedded Nas4Free installation, because the jail lives on one of your zfs pools or other hard disk. I remember all the ridiculous symlinking I had to do when I wanted to be able to run Java on my embedded Freenas 0.7.

This post looks long enough for now. Next will be an explanation about TheBrig.
Last edited by fsbruva on 17 May 2013 19:24, edited 1 time in total.

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#7

Post by fsbruva » 16 May 2013 23:17

TheBrig Info
TheBrig is a webgui manager for jails that uses PHP to perform the jail management tasks at the commandline. This is very similar to the rest of Nas4Free, which also uses PHP to carry out administrative tasks on the host OS. Also like Nas4Free, certain functional and design choices had to be made, as creating a GUI to deal with all the multitude of options available at the commandline is impossible. I apologize if I made a choice that you didn't agree with. PM me and we can discuss it.

TheBrig supports the following tasks:
1. Backing up the filesystems of existing jails created with other methods (mostly via the commandline following the Nas4Free wiki)
2. Importing the jail settings from an existing rc.conf.local
3. Starting/stopping jails
4. Modifying jail parameters
5. Deleting jails (it makes a backup tarball first, for safe keeping)
6. Determining compatible FreeBSD tarballs, then fetching them as a background task
7. Creating thin & full sized jails from tarballs and template jail
8. Display currently configured jails
9. Display current status of jail (running/stopped), including process counts
10. Tarball management to view and delete old backups or downloaded FreeBSD files
11. Can be run on either 32 or 64 bit Nas4Free
12. Can be run on either Full or Embedded install

Terminology
Thin jail - This is a fully functional jail, but when first installed, only occupies about 2 MB in its folder. This is because the majority of the userland programs (which shouldn't ever get modified) are stored elsewhere, and the jail is given read-only access to them. This means that after installing the first thin jail, you actually use about 300MB of space, but installing subsequent jails only adds 2 MB apiece. So, 4 thin jails take up only about 310 MB, instead of 1.2 GB!!!
Basejail - This is the repository of the bulk of the userland files used by all the thin jails on your system. It means only one system to keep updated, and it is completely protected from tampering by virtue of the read-only access. This means something going wrong in one jail can't affect the other jails.
Full jail - This is a full sized jail, about 300 MB per jail, and is completely self contained. This is the type of jail that was built by anyone who followed the wiki instruction.
Template jail - This is a folder that is set aside as a build destination. By this, I mean that anyone who followed the original wiki saw how to first build the proto jail, and then how to download all the source code for FreeBSD, and recompile a fresh, slimmer version for use in a new jail. These complicated steps will be implemented by TheBrig eventually, but not yet. For now, once you create your first jail, you will mount the template jail's folder someplace in the build jail. Then, you will carry out the steps to make buildworld, and the destination will be the template jail's folder. Subsequently, you can use TheBrig to create either full or thin jails based off this custom-built template.

I think that's it for now. Hopefully it makes sense, and you find TheBrig useful. I will keep you all posted as improvements continue to be implemented.
Last edited by fsbruva on 17 May 2013 02:35, edited 1 time in total.

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#8

Post by fsbruva » 16 May 2013 23:18

misterredman wrote:Are there instructions for importing existing jails (created manually following the wiki) into thebrig?
You have 2 options
1. go to Backup/restore page and use Jail Archiver tool. It make archive from old jail, arcive will push into /work folder. All old jail folder will without changes.
You can use archive, when you create new jail as source. I used this way, when I migrate my jail with Xapian-Omega indexer and MRTG. All start without any problem under TheBrig.
If you have many jails, and not have any jails, managed by TheBrig, you can try to use rc.conf.local Migrator. It convert wiki style rc.conf.local to TheBrig style xml. When you download xml, use Restore.
Image

2. Use Jail Location entry into TheBrig|Jail|Add tab. Just define path to your jail. In this case you need define all settings by hand (use full jail as jail type and Jail Source as from template )
64c0adb2761e.jpg
You do not have the required permissions to view the files attached to this post.

tortfeaser
NewUser
NewUser
Posts: 8
Joined: 27 Jun 2012 04:11
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#9

Post by tortfeaser » 17 May 2013 07:17

Wow, that all sounds great.

I'm really interested to try this out but have a set of jails that are working fine. I see you've some tools in mind to import existing setups that followed the wiki, as I did. A tutorial about importing would be great - I'd have some more confidence to give it a shot.

Marc

jdecker403
NewUser
NewUser
Posts: 2
Joined: 15 May 2013 05:39
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#10

Post by jdecker403 » 20 May 2013 22:22

Thanks! That's what it was.. I got it working. Another newbie question. I got thebrig setup on my system and working. Verified IP address and able to ping it. My question is I have backup of a previous jail that I created by hand. Not thru ezjail or anything else. I created a backup tar of it, by hand of course and just backup just the jail folder. By that I mean my jails directory is this
directory >> Jail
subdirectory -proto
subdirectory -www

Well I backup everything in the “www” working folder, that is it. I didn’t back anything like the conf directory or anything. Just the www folder which contains the base system and my websites. How can I import this into thebrig? Can I just create a working folder like www and copy the files over? Also what permissions do I need to set if any? Or do I need to create everything from scratch? Needless to say the system that was running my old system is gone so this is all I have. Any suggestions would be greatly appreciated!

Thanks…

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#11

Post by fsbruva » 20 May 2013 23:14

So were both "proto" and "www" jails? Did you happen to follow the wiki?

Do you want to replicate the jails, or just get your data off them? Both are options, but it sounds to me like you have a tarball that has two jails in it.

jdecker403
NewUser
NewUser
Posts: 2
Joined: 15 May 2013 05:39
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#12

Post by jdecker403 » 21 May 2013 03:17

Hi fsbruva,

Sorry for the confusion, my bad. No i just have one jail backed up as a tar which is www directory. This directory contain has the base install of course and my owncloud, ajaxplorer and wordpress. I had that jail set as my webserver jail. I've been reading through the wiki on this page but this evening I am going to try to see if I can do it. Last time I upacked the tar using the -p command it some how didn't let me view the contents of that directory with nas4free file manager. So I untar the backup on a windows machine and I will try to copy it to my nas4free. See how it goes.

loozhengyuan
Starter
Starter
Posts: 40
Joined: 06 Dec 2012 18:25
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#13

Post by loozhengyuan » 29 May 2013 11:52

Hello. I'm done installing and everything is going smoothly. But i do have a few questions, some of which might be quite elementary.

1. What happens if i update N4F to a newer version, does the extensions stay? Or does it not?
2. I understand the difference between a full jail and a thin jail. But essentially, which is better for which purpose?
3. I downloaded all the 4 types of BSD flavours. But I don't exactly know which one is to be used. Any directions/suggestions?

Thanks in advance!

mrjrussell
Starter
Starter
Posts: 49
Joined: 26 Jun 2012 04:31
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#14

Post by mrjrussell » 29 May 2013 18:33

I am also curious how to start the proccess of creating a jail for serviio and what is needed to be selected , I am building a test machine to try this out . I really want this to get a serviio install working side by side a subsonic and virtual box install on the same machine.




Found a issue you might get questions about:

If you dont create the folders "base" and "temp" for jails the query for tar balls fails and gives a error for network issues.
SGI Rackable NM46X, x64 Dual Processor - embedded on Dual-Core AMD Opteron(tm) Processor 8216 HE 16GB Ram -9.2.0.1 - Shigawire (rev 925)
My setup posting.php?mode=edit&f=63&t=179&p=363

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#15

Post by fsbruva » 30 May 2013 19:07

loozhengyuan wrote: 1. What happens if i update N4F to a newer version, does the extensions stay? Or does it not?
The extension's files are stored in non-temporary storage. As long as you don't touch the Nas4Free XML config, the extension's file operations carried out at startup will persist.
loozhengyuan wrote:2. I understand the difference between a full jail and a thin jail. But essentially, which is better for which purpose?
If you know that you are only going to ever have a single jail, then full is for you. Also, if you are going to be building a lot of FreeBSD software, then full is also for you. This is because the ports collection is notoriously bad about asking the system where it should look for or store files. Even though the thin jail has a custom make.conf, not all port respect that config.
loozhengyuan wrote:3. I downloaded all the 4 types of BSD flavours. But I don't exactly know which one is to be used. Any directions/suggestions?
Base is mandatory. Lib32 is mandatory for x64 systems. Src is optional, and used if you are going to be building some kernel modules. Doc is optional, and is only really useful for the man pages. I always use the internet's manpages, as they are hyperlinked with related programs.

mrjrussell -
Thanks for the heads up on your troubles. I will look into it. If you look in this forum (jails), there are a few HOWTO's, as well as in the extensions forum about getting subsonic or serviio or owncloud running in jail(s).

mrjrussell
Starter
Starter
Posts: 49
Joined: 26 Jun 2012 04:31
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#16

Post by mrjrussell » 01 Jun 2013 18:53

I was able to get this to install on 573 but im getting the same DNS errors on 249

I know the network settings are correct and the folders exist. I created the folders in filemanager with the 249 install but used terminal for my test virtual machine.

Is it possible the filemanager created folders are the issue?
SGI Rackable NM46X, x64 Dual Processor - embedded on Dual-Core AMD Opteron(tm) Processor 8216 HE 16GB Ram -9.2.0.1 - Shigawire (rev 925)
My setup posting.php?mode=edit&f=63&t=179&p=363

mrjrussell
Starter
Starter
Posts: 49
Joined: 26 Jun 2012 04:31
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#17

Post by mrjrussell » 04 Jun 2013 02:37

fsbruva wrote:I am sorry you are having trouble. It is likely a timeout issue. Where are you located?

Can you try immediately pressing "Query" again after the error message?
For some reason it wouldn't work i did a upgrade on the main system to 573 and it worked first try !
Maybe a issue with 249 ?
SGI Rackable NM46X, x64 Dual Processor - embedded on Dual-Core AMD Opteron(tm) Processor 8216 HE 16GB Ram -9.2.0.1 - Shigawire (rev 925)
My setup posting.php?mode=edit&f=63&t=179&p=363

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#18

Post by fsbruva » 04 Jun 2013 13:32

Okay, good to know! It might be an issue with 249. Now you have to change your signature! :-)

mrjrussell
Starter
Starter
Posts: 49
Joined: 26 Jun 2012 04:31
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#19

Post by mrjrussell » 04 Jun 2013 18:13

lol will do! Thanks for all the help.
SGI Rackable NM46X, x64 Dual Processor - embedded on Dual-Core AMD Opteron(tm) Processor 8216 HE 16GB Ram -9.2.0.1 - Shigawire (rev 925)
My setup posting.php?mode=edit&f=63&t=179&p=363

Iolar
NewUser
NewUser
Posts: 6
Joined: 10 Jun 2013 16:06
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#20

Post by Iolar » 10 Jun 2013 16:19

Hi,

Since this is my first post, I just wanted to say that this jail manager is great and saved me a lot of time, thanks. I'm just having a slight issue which I hope someone can help point me in the right direction.

I'm on an embedded 690 install onto which I've setup the jail as per the instructions and it shows up fine. However when I restart, the command script /usr/local/bin/php-cgi /mnt/..../conf/bin/thebrig_start.php doesn't appear to work. The extension thebrig no longer appears and the jail is also not running. That said if I run the command in a ssh session, thebrig reappears and the jail runs again (as long as I run php-cgi without the directory location). I've tried every way I can think of to run the command in the command scripts but nothing worked. Is there anyone else experiencing this issue? Any ideas on what the issue might?

Thanks in advance

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#21

Post by raulfg3 » 10 Jun 2013 19:12

Iolar wrote:Is there anyone else experiencing this issue? Any ideas on what the issue might?
No, sorry, TheBrig works fine for me. I imagine a permission problem.

please post more info about your install :
1 UFS or ZFS
2 do a ls -l of all folders that you think are involved ( folder you install TheBring, folder of your jails, etc..) to see ownwr and permission.
3 Post/atach in zip format your jail config
4 info about N4F (embeded or full?), version, etc...
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

fsbruva
Advanced User
Advanced User
Posts: 383
Joined: 21 Sep 2012 14:50
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#22

Post by fsbruva » 11 Jun 2013 08:31

Iolar wrote:(as long as I run php-cgi without the directory location).
This is because if you want to run it with the full path (/usr/local/bin/php-cgi), you need to preface it with a ".". The dot means you want to execute the thing you've specified.

As Raul said - more information a better diagnosis makes. I haven't made any modification to the start php script since I first got it working. Also, since you are able to get it running when you SSH in.... are you logging into SSH as root? The command script should be executed as root, also, so that is curious....

Iolar
NewUser
NewUser
Posts: 6
Joined: 10 Jun 2013 16:06
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#23

Post by Iolar » 11 Jun 2013 17:00

Hi,
I was working on a firewall today and while I was sorting out some access lists and NATs, it dawned on me what the issue was. I've other commands configured in the 'commands scripts', my script before thebrig command is actually something I created to continuously monitor services and IP address to allow for automatic shutdown when the server it not in use. When the commands scripts are run in sequence at boot, my custom script is run but as it never ends, it appears the remaining script (thebrig startup) never gets a chance to run.

I just deleted all the command scripts and put thebrig at the top and reinserted the remaining scripts and thebrig and my jail are running perfectly. Thanks to both of you for your speedy support and all the effort you've put into the application and tutorial. It's awesome stuff.

zakroma
Starter
Starter
Posts: 22
Joined: 26 Jun 2012 07:43
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#24

Post by zakroma » 15 Jun 2013 22:34

It takes forever to start a new jail. Any ideas what may be causing it?

Code: Select all

root         44712  34.5  0.4  29992 17016 ??  S     3:10AM  0:13.09 /bin/sh /etc/rc.d/jail start tinyp
And it's not the first time I'm trying to start it.

UPD got it all sorted by reinstalling the Brig! Works great now! Thanks!

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#25

Post by raulfg3 » 16 Jun 2013 08:45

something installed / config. start from scratch; delete the jail and create a new one, test that start correctly, add mount points, test one more time, install what you need , test one more time, once done you can determine if delay is in the jail or in the soft installed.

all step are starting / stoping by hand do not use automatic start of jail, until you are sure that works fine.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

WitDaGrin
NewUser
NewUser
Posts: 2
Joined: 04 Jun 2013 18:47
Location: Edmonton, AB Canada
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#26

Post by WitDaGrin » 03 Jul 2013 23:34

I'm having a problem starting the jail after I enter info into the Fstab box. If I leave it blank I can start and stop my jail no problem. If I enter the following,

mnt/Pool1/Dataset1/Music mnt/Pool1/Jail/minidlna/mnt/Music nullfs ro 0 0
mnt/Pool1/Dataset1/Pictures mnt/Pool1/Jail/minidlna/mnt/Pictures nullfs ro 0 0
mnt/Pool1/Dataset1/Video mnt/Pool1/Jail/minidlna/mnt/Video nullfs ro 0 0

The NAS4Free server webGUI is hung. I can get in with PuTTY though. I can see by my watt meter that the CPU is busy as the watt usage goes up by about 20 watts.

I have created the folders in the share and in the mnt of the jail. I tried to do a fresh FULL install of NAS4Free, but I get the same results. Any help would be greatly appreciated.

Thanks, Wayne

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#27

Post by raulfg3 » 04 Jul 2013 07:58

try adding a slash at the beginning:
/mnt/Pool1/Dataset1/Music /mnt/Pool1/Jail/minidlna/mnt/Music nullfs ro 0 0

and test one at time, if one works, try next.

Do not use autostart jail first time to avoid freze if your fstab is wrong, only when works fine by hand (start & stopt by hand), use autostart jail.
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

WitDaGrin
NewUser
NewUser
Posts: 2
Joined: 04 Jun 2013 18:47
Location: Edmonton, AB Canada
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#28

Post by WitDaGrin » 04 Jul 2013 15:19

I missed that. Thanks, that fixed it. I saw in a previous post not to autostart until the jails are working good, and now I see why. (I didn't have it enabled.) Thanks again for the prompt reply.

fredless
NewUser
NewUser
Posts: 4
Joined: 25 Jul 2013 23:17
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#29

Post by fredless » 25 Jul 2013 23:42

Okay, so I believe I followed the instructions here as correctly as I could determine, but my jails won't start.

I'm running a vanilla x64 embedded v775. I used the "3 commands" here to download and install, pointing to a folder on an ZFS mount (note that I did not create a dedicated dataset as suggested, is this a requirement?). I went through the rudimentary config (leaving everything default), successfully grabbed the four tarballs, and created a slim jail (again using all defaults, no extra mount commands, with all four tarball sources selected).

The jail appears to build correctly, and i see a bunch of files in it's assigned folder. But after I Apply Changes, and then hit the Power button to attempt to start the jail, my webGUI hangs, and watching top a new 'sh' process gradually (takes about a minute) ramps up and pegs one core completely. The new IP address does start answering ARP's/pings right away, but that's about it.

If I kill the pegged 'sh' process, the webGUI comes back to life immediately and I am back to where I started.

Have tried to rerun the install script to no avail. Also noticed a problem someone else complained about, when I reboot the system - the extension is gone. I have to rerun thebrig_install.sh to get it back again.

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4925
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install TheBrig - The default jail manager for N

#30

Post by raulfg3 » 26 Jul 2013 09:09

fredless wrote:pointing to a folder on an ZFS mount (note that I did not create a dedicated dataset as suggested, is this a requirement?)
No, is not a requeriment, is only usefull if you want to do a snapshot prior to create a new jail to have a cheap backup to restore in case that something goes wrong.
Create a dedicate dataset for jail is not mandatory , but Why not?.
fredless wrote:Have tried to rerun the install script to no avail. Also noticed a problem someone else complained about, when I reboot the system - the extension is gone. I have to rerun thebrig_install.sh to get it back again.
this is not normal, please reinstall "TheBring", but this time from a shell ( I use putty to connect to my SSH NAS), in my first post , there are a example:

Code: Select all

    Welcome to NAS4Free!
    rnas:~# fetch -o /tmp/thebrig_install.sh https://github.com/fsbruva/thebrig/raw/master/thebrig_install.sh
    /tmp/thebrig_install.sh                       100% of 2824  B  118 kBps
    rnas:~# chmod a+x /tmp/thebrig_install.sh
    rnas:~# /bin/sh /tmp/thebrig_install.sh /mnt/NAS-A/Jail
    Retrieving the most recent version of TheBrig
    master.zip                                    100% of  178 kB   46 kBps
    Unpacking the tarball...
    x README
    x conf/
    x conf/bin/
    x conf/bin/ftp_amd64
    x conf/bin/ftp_i386
    x conf/bin/thebrig_fetch.sh
    x conf/bin/thebrig_start.php
    x conf/bin/thebrig_start.sh
    x conf/bin/thebrig_stop.sh
    x conf/ext/
    x conf/ext/thebrig/
    x conf/ext/thebrig/extensions_thebrig.php
    x conf/ext/thebrig/extensions_thebrig_check.php
    x conf/ext/thebrig/extensions_thebrig_config.php
    x conf/ext/thebrig/extensions_thebrig_download.php
    x conf/ext/thebrig/extensions_thebrig_edit.php
    x conf/ext/thebrig/extensions_thebrig_tarballs.php
    x conf/ext/thebrig/extensions_thebrig_tools.php
    x conf/ext/thebrig/functions.inc
    x conf/ext/thebrig/lang.inc
    x conf/ext/thebrig/menu.inc
    x conf/ext/thebrig/off_small.png
    x conf/ext/thebrig/on_small.png
    x conf/freebsd-update.conf
    x conf/portsnap.conf
    x thebrig_install.sh
    Renaming 64 bit ftp binary
    Congratulations! Refresh to see a new tab under " Extensions"!
    rnas:~#
please post your result and compare, perhaps you have some error / discrepancy here.

fredless wrote:The jail appears to build correctly, and i see a bunch of files in it's assigned folder. But after I Apply Changes, and then hit the Power button to attempt to start the jail, my webGUI hangs
, ok, TheBring need some time to unpack tarballs, please wait 5 minutes betwen push buttons, ( wait first time 10 minutes prior to push Start power button), if still hangs more info are needed.

post screen capture of how you configure your jail, post your "theBrig" config.xml file, etc...

Remenber that if your system is 32bit ( not 64bit), when you create a slim jail you do not need lib32.txz, in fact the only tarball that yu need to select is base.txz as I show in working_jail_2.jpg
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

Post Reply

Return to “Jails”