Maybe an error in the handbook - Updating Multiple Jails

Its written in

Updating Multiple Jails
15.5.1. Creating the Template​

5. Now, symlink the read-write file system to the read-only file system. Ensure that the symlinks are created in the correct s/ locations as the creation of directories in the wrong locations will cause the installation to fail.

# cd /home/j/mroot
# mkdir s
# ln -s s/etc etc

but ln is defined as "ln -s source_file [target_file]"

Because, we have just created the "s" directory how can we link from the "source file" s/etc to anything?

I can not understand that.
 
The key to understand this part is to keep in mind that symlinks are not evaluated when you create them, they are only evaluated when you access them.

With this in mind, you can now understand that if you run the ln command, the command will succeed, however if you then immediately try to follow the symlink before mounting the file systems of the jail as explained in the tutorial you are following, you will see a file not found error or an empty directory.

The point is, sym linking a path not existing yet is not an issue, as long as you ensure that the link will resolve properly when you will actually access it. After mounting the file systems of the jail, you will see that the sym link points to what you expect... if you follow/evaluate the link after mounting the file systems (see the part of the tutorial talking about the fstab file) ;)

I use this section of the handbook regularly and I can confirm that it works fine and there is no typo.
 
Back
Top