|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
help for setting ezjail?
this is what i did:
#cd /usr/ports/sysutils/ezjail && make install clean #cp /usr/local/etc/ezjail.conf.sample /usr/local/etc/ezjail.conf #vi /usr/local/etc/ezjail.conf #and I uncomment all, so my conf have default values #ezjail-admin update #ifconfig rl0 alias 192.168.1.50 netmask 255.255.255.0 #echo 'ifconfig_rl0_alias0="inet 192.168.1.50 netmask 255.255.255.0"' >> /etc/rc.conf #ezjail-admin create www.my-domain.com 192.168.1.50 #/usr/local/etc/rc.d/ezjail.sh start #jail /usr/jails/www.my-domain.com www.my-domain.com 192.168.1.50 /bin/sh and i get this error: jail: execv: /bin/sh: No such file or directory #ls -la /usr/jails/www.my-domain.com ... lrwxrwxrwx 1 root wheel 13 Jun 13 18:34 bin -> /basejail/bin ... #/usr/jails/www.my-domain.com/basejail is empty #/usr/jails/basejail/bin has sh # ezjail-admin list ... DS N/A 192.168.1.50 www.my-domain.com /usr/jails/www.my-domain.com do i need to change some path in some conf? or i must copy all files from /usr/jails/basejail/ to each jail's basejail directory? or i miss something important for creating jail with ezjail? edit: i'm using FreeBSD 6.2-RELEASE and ezjail-2.1 Last edited by bgobs; 13th June 2008 at 04:49 PM. |
|
||||
Looks like you left off admin update?
I have a page on it at http://www.scottro.net/qnd/qnd-ezjail.html |
|
|||
Quote:
this? if its not this - what update ? just in case i did: #ezjail-admin update -i but i still have the same error...
__________________
FreeBSD 6.2 RELEASE |
|
||||
No, that's what I meant, I missed it on first reading I was rushing. (as I am now, I fear, so if I miss something you already wrote that you did, I apologize.)
There should be a file in /usr/local/etc/ezjail called www.doman. As for ezjail.conf.sample, you should be able to leave it alone, rather than renaming and uncommenting it, unless things have drastically changed. Maybe that's the issue? Did you look at the page I mentioned? If not, go back and try it that way again and see if you have any luck. |
|
|||
Quote:
my domain have a dash. and this file looks like this: www_my_domain_com the dash and the dots are replaced with underscore. hmf.. i think that this is ok. i'll try with different domain. just to test. Quote:
ezjail.conf.sample exist as original ezjail.conf.sample Quote:
yes, i know your site.. i even use it and there is smth else.. after update (if i dont lie myself) there was a text saying that there is some deamons watching all ip's and that could be a confilct... i dont remember.. i have one hdd and i use it only for backup. tomorrow i'll try a clean freebsd install (minimal), and then i'll try again ezjail. ... i dont have any expiriance with unix/linux. im "playing" with freebsd for about 2 weeks. i'm surprised that i install apache, php, mysql, dovecot, postfix, postfixadmin, spamassassin, squirrelmail and phpmyadmin and they ALL are working of course i had problems with them like i have problems with ezjail now. but all will work. its just a matter of time.
__________________
FreeBSD 6.2 RELEASE |
|
||||
Ok, I kept reading in a hurry today, so we'll take it step by step. (The fact that your /usr/local/etc/ezjail's domain name had dashes was fine--it should be whatever you called it.)
Quote:
I don't see them causing the error though. #ezjail-admin update I would have done this, and left out the copying of the sample config. As you say you are going to retry the whole thing, leave that part (copying the sample). doing it the way you did, ezjail-admin update is actually better than doing it with -i, as it will make sure it's really up to date. #ifconfig rl0 alias 192.168.1.50 netmask 255.255.255.0 #echo 'ifconfig_rl0_alias0="inet 192.168.1.50 netmask 255.255.255.0"' >> /etc/rc.conf Ok, I see one mistake here--the alias should be 255.255.255.255 (or 0xffffffff (that's zero x, not the capital letter o.) Still doesn't cover the shell issue though. (I also see that there was an error there on my ezjail page, which I've now corrected.) More commonly., you'd just do 192.168.1.50/32 #ezjail-admin create www.my-domain.com 192.168.1.50 Now, you should check /usr/local/etc/ezjail to make sure it's in there, and that the lines mentioned on my page are there, at least most of them. #/usr/local/etc/rc.d/ezjail.sh start This went without error messages, right? #jail /usr/jails/www.my-domain.com www.my-domain.com 192.168.1.50 /bin/sh and i get this error: jail: execv: /bin/sh: No such file or directory Ok, that shouldn't have happened, as we know. #ls -la /usr/jails/www.my-domain.com ... lrwxrwxrwx 1 root wheel 13 Jun 13 18:34 bin -> /basejail/bin ... #/usr/jails/www.my-domain.com/basejail is empty That is probably the issue. I'm not sure why that happened, and it sounds as if something went wrong in the install. I'm sorry for the false info I gave earlier, as I said, I only had a little time to look at your post. |
|
|||
Quote:
Quote:
Check your /usr/jail/whatever/bin and make sure it's a softlink (ln -s) to "/basejail/bin". Here's an example of one of my jails (note: I have customized the jail layout a bit but you should get the general gist of things) Code:
-r--r--r-- 1 root wheel 6188 May 13 02:05 COPYRIGHT lrwxrwxrwx 1 root wheel 9 May 13 02:05 bin -> /fbsd/bin lrwxrwxrwx 1 root wheel 10 May 13 02:05 boot -> /fbsd/boot drwxr-xr-x 9 root wheel 512 May 28 21:31 contrib dr-xr-xr-x 4 root wheel 512 Jun 11 20:17 dev drwxr-xr-x 21 root wheel 2560 Jun 9 02:04 etc drwxr-xr-x 9 root wheel 512 Apr 28 21:26 fbsd lrwxr-xr-x 1 root wheel 8 May 13 02:09 home -> usr/home lrwxrwxrwx 1 root wheel 9 May 13 02:05 lib -> /fbsd/lib lrwxrwxrwx 1 root wheel 13 May 13 02:05 libexec -> /fbsd/libexec drwxr-xr-x 2 root wheel 512 May 13 02:05 media drwxr-xr-x 2 root wheel 512 May 13 02:05 mnt dr-xr-xr-x 1 root wheel 0 Jun 13 17:40 proc lrwxrwxrwx 1 root wheel 12 May 13 02:05 rescue -> /fbsd/rescue drwx------ 2 root wheel 512 May 24 06:54 root drwxrwx--- 3 root sysadmin 512 May 23 17:25 sahome lrwxrwxrwx 1 root wheel 10 May 13 02:05 sbin -> /fbsd/sbin lrwxrwxrwx 1 root wheel 11 May 13 02:05 sys -> usr/src/sys drwxrwxrwt 9 root wheel 512 Jun 13 11:52 tmp drwxr-xr-x 6 root wheel 512 May 13 02:43 usr drwxr-xr-x 23 root wheel 512 Jun 11 20:17 var drwxr-xr-x 6 root www 512 Jun 2 12:48 www
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident! |
|
|||
is there a way to log everything from jails?
jls has no output. i think that this is wrong.. ezjail-admin list has output. ezjail.sh start has no output. ***** EDIT: when I: #make deinstall clean remove all ezjail's files and folders #make install clean #ezjail-admin update -i I get the following error: Quote:
__________________
FreeBSD 6.2 RELEASE Last edited by bgobs; 14th June 2008 at 04:29 PM. |
|
|||
Ah ha! I think I have it now.
If jls is showing nothing, then there are no jails running. Do you have Code:
ezjail_enable="YES"
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident! |
|
|||
Quote:
***** EDIT: @scottro i think you should move up this step in your QND (with some explanations about the real meaning; its not just "running at boot"): Quote:
Quote:
its a good howto anyway! my problem was, that i just testing ezjail... i have plans to run it after new freebsd install and of course i will build all my services inside jails.
__________________
FreeBSD 6.2 RELEASE Last edited by bgobs; 14th June 2008 at 09:17 PM. |
|
||||
Thank you and you're right. I will do that now.
You can also use forcestart when it's not in rc.conf, e.g., /usr/local/etc/rc.d/ezjail forcestart. I'll mention both. Thank you for the input, it's stuff like that that helps me improve these things. |
|
|||
I too used your guide when first setting up my ezjails - so thanks scottro.
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dhcpd within ezjail? | zelut | FreeBSD General | 7 | 10th February 2009 10:31 PM |
ezjail /usr/home users and groups question | neurosis | FreeBSD Security | 7 | 8th September 2008 08:40 PM |
Jails, ezjail, apache, very newbie question. | neurosis | FreeBSD General | 15 | 23rd August 2008 01:38 PM |
Setting Up MPD | benjgvps | FreeBSD General | 0 | 21st May 2008 12:20 PM |
thanks for setting this up | DraconianTimes | Off-Topic | 8 | 5th May 2008 08:14 AM |