@rbaldwin Mind trying out the working-RC-7 branch?
I’ve created the postinitscripts stuff.
The way it works is VERY similar to postdownload scripts, but runs before anything dealing with taskings is called (within the /bin/fog script).
It’s a “first” attempt so there may be some issues…
The “quick and dirty” documentation:
FOG Will create a folder in the capture folder of the server called postinitscripts. (E.G. typically /images/dev/postinitscripts)
Installer
FOG Will create a folder in the capture folder of the server called postinitscripts. (E.G. typically /images/dev/postinitscripts)
This will happen on the installer if the postinitscripts folder does not already exist.
FOS
- When the init’s load and call the
/bin/fog script (last part of S99fog IIRC) the postinitscripts directory will be mounted.
- Right before the main script for the tasking is started, it will run through the postinitscripts as defined in the fog.postinst script.
- Will unmount the nfs that was mounted so the download/upload tasks will be able to mount where they are expecting to get/put the data.
Note/Suggestion
When calling scripts I like to lean more to sourcing in the script rather than implicit call (. somescript vs somescript) as it will allow “fallthrough” of variables/functions within your postinit that you could use later on (say postdownloadscripts for example).
General needed knowledge
The fog.postinit script should really only be used to call other scripts but this is not a requirement. It is, after all, a bash script.
The scripts you want to use for postinit must go in the postinitscripts directory. They will also need to be executable. (Normal script type stuff).
Caution/Recommends
The sourced path is to the mountpoint naturally and stored in the variable $postinitpath.
You can directly get the path you want, but this variable should be used in my opinion.
In the case of download scripts the image mountpoint will always be:
/imagestorelocationonserver->/images.
In the case of upload scripts the image mountpoint will always be:
/imagestorelocation/dev->/images
In download mode, the dev folder would be visible directly. So a path of /images/dev/postinitscripts/somescript would work.
In upload mode, the dev folder would not be visible. So postinitscripts would never be accessible if you left the /dev/ in the path. I’ve added corrective items for this postinit to try to make sure this would not break the variable and skip it.
Summary
Hopefully all will be well and I got it right the first go around (highly unlikely but I can be hopeful right?) The init’s have been updated and should support this. I will run a test just to see (though I’m not mounting I should be able validate the system is working.