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.
Remove the dashes (-) from the variable names. That causes problems within the scripts.
<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>
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: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?
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"
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.
poweroff
command....
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:
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.
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.
I have a page about using nullfs mounts that some have found helpful. (But be sure to see the FreeBSD-10 section, which discusses how entries go in /etc/jails.conf, not /etc/rc.conf.
https://srobb.net/nullfsjail.html
I use ezjail. Works fine, and that section in the Handbook is recent.
That's what ezjail does. A shared "basejail", and ports tree.Couldn't find any info on thinjails with ezjail.
That's what ezjail does. A shared "basejail", and ports tree.
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”.
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.
That's what ezjail does. A shared "basejail", and ports tree.
# 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.
# service jail start qa
Cannot 'start' jail. Set jail_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
# 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]