1

I'm trying to start jail in FreeBSD 9

configs:

etc/rc.conf:

#jails:
jail_enable="YES"
jail_interface="re0"    
jail_devfs_enable="YES"  
jail_procfs_enable="YES" 
jail_set_hostname_allow="YES"

jail_list="test"     
ifconfig_em0_alias0="inet 192.168.9.254 netmask 255.255.255.255"
jail_test_rootdir="/usr/home/jails/test.local"   
jail_test_hostname="test.local"    
jail_test_ip="192.168.9.254"   
jail_test_interface="re0"   
jail_test_devfs_enable="YES"   
jail_test_procfs_enable="YES" 

jail_test_exec_start="/bin/sh /etc/rc"
jail_test_exec_stop="/bin/sh /etc/rc.shutdown"
jail_test_flags="-l -U root"      

After this I'm trying to start it:

mybsd#jail start

or mybsd#jail start test But both commands return such error:

jail: no -c or -m, so this must be an old-style command.
But it doesn't look like one.

Please, advise how to start jail in "new-style" command?

Thanks a lot!

Vlad
  • 63
  • 9
  • I'd try `jail -c test`, but I don't have a FreeBSD machine handy to try it myself. – Joachim Isaksson Dec 26 '12 at 21:44
  • uname -a: `FreeBSD pcbsd-7104 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 ` – Vlad Dec 27 '12 at 08:20
  • 2 Joachim Isaksson: `jail -c test` told that 'test is unknown parameter' – Vlad Dec 27 '12 at 08:21

2 Answers2

0
jail_test_flags="-l -U root" 

does not seem necessary.

Also, for easy jail usage, I strongly recommend: http://people.virginia.edu/~ll2bf/docs/nix/freebsd_jail.html

hari
  • 8,775
  • 24
  • 67
  • 104
0

I don't think this is the whole problem, but you have a mismatch between:

ifconfig_em0_alias0=

and

jail_test_interface="re0"

Is the jail on em0 or re0?

As far as how to start the jail, try:

service jail start

That should start all the jails.

Also, I'd suggest trying ezjail. It makes things a little simpler to manage.

Steve Wills
  • 710
  • 4
  • 8