I have been trying to set up few jail templates, which sysutils/ezjail calls flavours. So far I haven't had any problems. There is only one step that I don't seem to resolve. As part of the default template I would like to mount (nullfs) in all jails my package repository that I have already prepared using poudriere. This information is entered in /etc/fstab.JAILNAME and has to be set up from the host and not within the jail. I can't find a way to make this information part of the template/flavour.
The only way is to manually change /usr/local/bin/ezjail-admin
by adding another line with my mount points.
This is not very elegant, so is there a better solution? Any suggestions?
Of course I can set up an httpd for the repository and so will only need to adjust pkg.conf in the jail, which should be a bit easier. However the repository will be used only by the jails of the same machine so I didn't want to add an unnecessary service.
The only way is to manually change /usr/local/bin/ezjail-admin
Code:
# if the automount feature is not disabled, this fstab entry for new jail
# will be obeyed
echo -n > /etc/fstab.${ezjail_safename}
if [ "${ezjail_imagetype}" -a "${ezjail_imagetype}" != "zfs" ] ; then
echo ${ezjail_devicelink} ${ezjail_rootdir} ufs rw 0 0 >> "/etc/fstab.${ezjail_safename}"
fi
echo ${ezjail_jailbase} ${ezjail_rootdir}/basejail nullfs ro 0 0 >> "/etc/fstab.${ezjail_safename}"
by adding another line with my mount points.
This is not very elegant, so is there a better solution? Any suggestions?
Of course I can set up an httpd for the repository and so will only need to adjust pkg.conf in the jail, which should be a bit easier. However the repository will be used only by the jails of the same machine so I didn't want to add an unnecessary service.