Solved EZJail Flavour rc.d script not executing in FreeBSD 13

Hi all,

First of all, apologies if this was covered elsewhere, or is blatantly obvious. I am very new to FreeBSD, have been trying to figure this out for the better part of a day, and don't really have anywhere else useful to post something that might be helpful for other people trying to set up flavours in ezjail on FreeBSD 13!

TL;DR: if you try to set up an ezjail flavour by copying the example flavour, be sure to rename your script to not use periods or other special characters in its name!

The problem: I've successfully installed and configured ezjail, and created a new flavour by copying the example ( cp -r /usr/jails/flavours/example /usr/jails/flavours/mybridged), per the ezjail docs. I opened the ezjail flavor example file and renamed it to ezjail.flavour.mybridged. I've added some commands and verified syntax by running source ezjail.flavour.mybridged as root. When I create a new jail ( ezjail-admin create -f mybridged jtest 'lo1|127.0.1.1'), and start it up, it starts up instantly (it shouldn't, I'm installing pkg and some packages). When I go to a console, I find that my ezjail.flavour.mybridged script never ran and is still in its original place in /etc/rc.d. If I try to execute it manually ( ./etc/rc.d/ezjail.flavour.mybridged), I get eval: ${ezjail....}: Bad substitution.

In researching this issue, I stumbled across this thread, which mentions some syntax changes for shell scripts. I noticed that his script name used underscores instead of periods in the filename and $name. Maybe the interpreter doesn't like periods too?

Turns out: it doesn't! Changing the filename and $name var to use underscores fixes the issue. On my next jail creation, ezjail-admin console -f jtest2 takes an appropriate amount of time and my customizations are present. Problem solved!

(The previous thread I mentioned didn't seem to state a resolution, despite the 'solved' tag, so I am making this thread so that others that stumble on this issue might know the solution. There are numerous examples on the net showing older syntax, so I hope this thread helps alleviate confusion. Not really expecting any discussion)
 
Back
Top