Modifying hook scripts within jail meta folder

Status
Not open for further replies.

JavaScriptDude

Dabbler
Joined
Nov 5, 2011
Messages
22
While trying to solve a problem with auto mounting using nullfs(5) on boot of a jail on my FreeNAS box, I came across the hidden meta folder /mnt/<ZVOL>/jails/.<JAIL_ID>.meta which contains several read only hook scripts. After adding a few lines to the jail-post-start script, I was able to solve the problem without issues and the change has been in production for several months.

I scoured the internet for documentation, I found no discussion of these hooks in the .meta folder. Can someone shed some light on the intent of these hooks scripts? Is it safe for admins to alter these scripts by hand to add implementation specific configurations? Are there plans to dynamically overwrite these scripts as a result of changes in a GUI?

The list of hooks in each jail's .meta folder are:
  • jail-pre-delete
  • jail-pre-start
  • jail-pre-stop
  • jail-post-delete
  • jail-post-start
  • jail-post-stop
 
D

dlavigne

Guest
It's possible that noone knows. Also, no improvements (and few bug fixes) are being made to 9.x jails/plugins as the devs concentrate on getting 10 out the door.

For those reasons, if modifying those scripts solves your issues, go for it, keeping in mind that you'll probably have to remodify after every update.
 

JavaScriptDude

Dabbler
Joined
Nov 5, 2011
Messages
22
From reading the source code, it appears that the scripts are only overwritten when the jail is initially created and deleted when the jail is deleted.

I will put my changes into VC so I don't loose the configurations when it comes to upgrade time.

Considering how useful the scripts are, we should consider documenting them or maybe even adding a formal persistent extension mechanism for these events so that others can leverage them for their needs.

Thanks again Dru.
- Tim
 
Status
Not open for further replies.
Top