This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

Help - Setup Squid Proxy Cache & Webmin on Nas4Free

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
darrcauk
NewUser
NewUser
Posts: 9
Joined: 20 Jan 2013 15:29
Status: Offline

Help - Setup Squid Proxy Cache & Webmin on Nas4Free

Post by darrcauk »

Hi Guys,

I am just trying to get a Jail running so that i can install squid and webmin to administer squid. squid's cache will probably be big so installing it on the 16gb memory stick would not be an option as it will probably fill up very quickly, it has to run on the data drive on ZFS

Senario: ZFS pool (called pool), dedicated dataset for the jail (called pjail), so what you would see is the following: /mnt/pool/pjail/.....

I did the following:

mkdir /jail
mkdir /mnt/pool/pjail/jail
mkdir /mnt/pool/pjail/jail/{work,proto,conf}
mount_nullfs /mnt/pool/pjail/jail /jail
cd /jail/work
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/base.txz
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/lib32.txz
tar xvf /jail/work/base.txz -C /jail/proto/
tar xvf /jail/work/lib32.txz -C /jail/proto/
cd /jail
mkdir -p conf/root/{etc/rc.d/,usr/bin,usr/sbin}
cp proto/etc/rc.d/jail conf/root/etc/rc.d/
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp proto/usr/bin/mktemp conf/root/usr/bin/
cp /etc/resolv.conf /jail/proto/etc/
touch /jail/conf/fstab.proto
cp /jail/proto/usr/share/zoneinfo/Europe/London /jail/proto/etc/localtime
nano conf/rc.conf.local
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto http://www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.local" # hostname
jail_proto_ip="192.168.100.20" # 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

nano /jail/conf/jail_start
#!/bin/tcsh -x
#mounting to /jail
mount_nullfs /mnt/data/jail /jail
# Attach jail files to /usr and /etc
mount_unionfs /jail/conf/root/etc/ /etc
mount_unionfs /jail/conf/root/usr/ /usr
rehash
#start all jails
/etc/rc.d/jail start

chmod 777 /jail/conf/jail_start

Questions:
1. Why can't someone just get the jail functionality that is in freenas ported into nas4free, it took me 5 minutes on freenas to get jail functionality working, surely you can make it easier, especially for newbes, to get it up and running?

2. When my server reboots i noticed when it comes to the point when it is supposed to run the postini script to start the jail, it says file not found, possibly due to ZFS not being loaded yet ? How do i get around this ?

I have been at this from 8am to 4pm and I am more than just $%^$&$£ frustrated.

Regards
DC

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

Re: Help - Setup Squid Proxy Cache & Webmin on Nas4Free

Post by fsbruva »

darrcauk wrote: mount_nullfs /mnt/pool/pjail/jail /jail
Good.
darrcauk wrote: nano /jail/conf/jail_start
#!/bin/tcsh -x
#mounting to /jail
mount_nullfs /mnt/data/jail /jail
See the error?
darrcauk wrote:1. Why can't someone just get the jail functionality that is in freenas ported into nas4free,
A couple reasons. 1. Freenas has a completely re-written web interface, so "porting" is not at all insignificant, simple, or straightforward 2. Freenas developers are paid to develop 3. The Freenas jail is tightly coupled with the Freenas development/release. Myself and another user are working on it. But we both have full-time jobs and wives.
darrcauk wrote:2. When my server reboots i noticed when it comes to the point when it is supposed to run the postini script to start the jail, it says file not found, possibly due to ZFS not being loaded yet ? How do i get around this ?
I'll bet this is because the mount_nullfs is not mounting to the correct location. The file is truly not there, based on the mount. Postinit tasks are run after the file systems are mounted and the server has networking and altogether finished booting.
darrcauk wrote:I have been at this from 8am to 4pm and I am more than just $%^$&$£ frustrated.
I am truly sorry to hear this, and I know how it feels. As we've been working on the extension, I have experienced the "WHY THE #)$(@#)%(^& ISN'T THIS WORKING!?!?!?" moment more times than I can count. Hopefully the fix I identified above will help relieve your stress.

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: Help - Setup Squid Proxy Cache & Webmin on Nas4Free

Post by alexey123 »

Mmm I don't agree use Nas as gateway.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

Post Reply

Return to “Jails”