Solved Starting jails ... jail ignored?

First, I would like to thank anyone for their assistance.

I am unable to start jails. The jails were configured using the example in 14.5 of the handbook.

The error I receive is the following:

001.png
 
Remove the dashes (-) from the variable names. That causes problems within the scripts.
 
Hi euphrus,

The new way to define jails is through jail.conf(5) instead of through rc.conf(5). Unfortunately, the handbook has not been updated to reflect this, but there are plenty of guides on the internet to walk you through it. Here's a nice tutorial to help you get started. A reference of all the parameters you can use in jail.conf(5) can be found in jail(8).

This is unrelated to jails, but you should read Thread The value of format tags.55543 and use code tags instead of images for text. Using tags makes it easier for others to read your posts.
 
This is unrelated to jails, but you should read Thread The value of format tags.55543 and use code tags instead of images for text. Using tags makes it easier for others to read your posts.

<rant type="offtopic">Especially since non-logged in users only see a small thumbnail and can't see the full-size image unless they log in / create an account. (I was logged out, saw the thumbnails, got an "you aren't authorized" page, and had to log in just to see the image.)

I normally, explicitly, stay logged out of web sites unless I need to log in, for some reason. This is a dumb reason to require logging in, IMO.</rant>
 
Remove the dashes (-) from the variable names. That causes problems within the scripts.

Those are the actual directory names. Is using dashes not allowed for directory/file naming or do I need to reflect them in the script differently?
 
<rant type="offtopic">Especially since non-logged in users only see a small thumbnail and can't see the full-size image unless they log in / create an account. (I was logged out, saw the thumbnails, got an "you aren't authorized" page, and had to log in just to see the image.)

I normally, explicitly, stay logged out of web sites unless I need to log in, for some reason. This is a dumb reason to require logging in, IMO.</rant>


Thank you and apologies.
 
Those are the actual directory names. Is using dashes not allowed for directory/file naming or do I need to reflect them in the script differently?
What SirDice is talking about is the actual variable name, not the path. To make your jail work, you would have to make the jail part of your rc.conf look something like this:
Code:
jail_enable="YES"
jail_set_hostname_allow="NO"
jail_list="www_php"

jail_www_php_hostname="www.sandbox.com"
jail_www_php_ip="192.168.1.11"
jail_www_php_rootdir="/usr/home/j/www-php"
jail_www_php_devfs_enable="YES"

Notice the change from hyphens to underscores in the variable names. However, if you switched to the jail.conf(5) method, then you wouldn't have to worry about not including hyphens in variable names as it is perfectly safe to do so.
 
What SirDice is talking about is the actual variable name, not the path. To make your jail work, you would have to make the jail part of your rc.conf look something like this:
Code:
jail_enable="YES"
jail_set_hostname_allow="NO"
jail_list="www_php"

jail_www_php_hostname="www.sandbox.com"
jail_www_php_ip="192.168.1.11"
jail_www_php_rootdir="/usr/home/j/www-php"
jail_www_php_devfs_enable="YES"is

Notice the change from hyphens to underscores in the variable names. However, if you switched to the jail.conf(5) method, then you wouldn't have to worry about not including hyphens in variable names as it is perfectly safe to do so.

I understand now - thank you.

I also see you added an 'is' at the end (I imagine it's a typo)

I do plan on using jail.conf after reading [URL='https://therub.org/2014/08/11/convert-freebsd-jails-from-rc.conf-to-jail.conf/']HERE[/URL] that FreeBSD 11 will probably drop support for the rc.conf style.
However, initially since I'm learning I thought I'd go by the manual first.
 
Currently re-installing FreeBSD.
Apparently I did something wrong before powering off last time.
...couldn't find bin/sh - wouldn't let me login...

I'll need to take a snapshot before I try new things.
...make buildworld (again - arghhh LOL)
 
The "is" at the end was indeed a typo and I've edited my post to fix it. Thanks for pointing that out.

Unfortunately, the handbook can be out of date sometimes, which can lead to instances where it is better to follow other sources which contain more relevant information.

I can't find anything on the wiki page of the changes in 11 that suggests the old rc.conf method will become unsupported, but as the page says, the information may not be complete.
 
ARGH... - HELP!!!

After completing the instructions upto the point of editing /etc/fstab.
I stopped and shutdown the virtual machine with the poweroff command.

Today, I returned and started up the VM and am receiving the following error:

Code:
...
Starting file system checks:
Mounting local file systems:mount: /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
mount /usr/home/j: No such file or directory
.
Mounting /etc/fstab filesystems failed, startup aborted
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
Jun 4 02:40:57 init: /bin/sh on /etc/rc terminated abnormally, going to single user mode
Enter full pathname of shell or RETURN for /bin/sh:
 
...well, since it mentioned /etc/fstab
I commented all the lines I introduced for the creation of jails, then everything worked.

Now that I am in again, I will un-comment and continue where I left off.

This has been so much more difficult than I expected.

I thank you all for your patience thus far.
If this was a Linux forum I would have RTFMs and other demeaning comments - thank you for your professionalism and patience.
Doing my best, reading the manual and applying a little common sense...
 
You're better off automating the nullfs(5) mounts using the mount and mount.fstab options for jails:

Code:
     mount   A filesystem to mount before creating the jail (and to unmount
             after removing it), given as a single fstab(5) line.

     mount.fstab
             An fstab(5) format file containing filesystems to mount before
             creating a jail.

Also consider moving away from rc.conf(5) configuration for jails, using a dedicated /etc/jail.conf makes certain things much easier to manage.
 
You're better off automating the nullfs(5) mounts using the mount and mount.fstab options for jails:

Code:
     mount   A filesystem to mount before creating the jail (and to unmount
             after removing it), given as a single fstab(5) line.

     mount.fstab
             An fstab(5) format file containing filesystems to mount before
             creating a jail.

Also consider moving away from rc.conf(5) configuration for jails, using a dedicated /etc/jail.conf makes certain things much easier to manage.


In fact, that is why I shutdown the machine before moving to the step that calls for editing rc.conf. I plan on using jail.conf - after many recommendations and some reading.

Question: I've noticed there are still some lines that need to go in rc.conf when using jail.conf, can anyone point me to some good documentation? I don't want the usual 'do this' type docs, but also some explanation to what it is I am actually doing.
 
Sorry, that's about the only one I have--there's a handbook article on it (linked on my page) that also talks about it. The other method to do it that way is to use ezjail or similar, which also makes use of nullfs, however, I haven't used ezjails in years.
 
That's what ezjail does. A shared "basejail", and ports tree.

I stopped at 14.5 because of

This section demonstrates one method to resolve this issue by safely sharing as much as is possible between jails using read-only mount_nullfs(8) mounts, so that updating is simpler. This makes it more attractive to put single services, such as HTTP, DNS, and SMTP, into individual jails. Additionally, it provides a simple way to add, remove, and upgrade jails.

Note:
Simpler solutions exist, such as ezjail, which provides an easier method of administering FreeBSD jails but is less versatile than this setup. ezjail is covered in more detail in Section 14.6, “Managing Jails with ezjail”.

ezjail does seem like what I want...

Creating and managing multiple jails can quickly become tedious and error-prone. Dirk Engling's ezjail automates and greatly simplifies many jail tasks. A basejail is created as a template. Additional jails use mount_nullfs(8) to share many of the basejail directories without using additional disk space. Each additional jail takes only a few megabytes of disk space before applications are installed. Upgrading the copy of the userland in the basejail automatically upgrades all of the other jails.

What's the benefit of doing it the hard way?
 
That's what ezjail does. A shared "basejail", and ports tree.

I have just tried ezjails and have encountered another issue:

Code:
# ezjail-admin start qa
Starting jails: cannot start jail  "qa":
ifconfig: interface l01 does not exist
jail: qa: /sbin/ifconfig l01 inet 127.0.3.1/32 alias: failed
.
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider to migrate to /etc/jail.conf.
Error: Could not start qa.
  You need to start it by hand.

I tried starting manually:

Code:
# service jail start qa
Cannot 'start' jail. Set jail_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

changed the entry in /etc/rc.conf from ezjail_enable="YES" to jail_enable="YES" and attempted to start manually:

Code:
# service jail start qa
Starting jails:/etc/rc.d/jail: WARNING: Invalid configuration for qa  (no jail.conf, no hostname, or no path).  Jail qa was ignored.
[/CDOE]
 
Back
Top