@hegdemahendra
This is not something I have tried before, but...
When you execute the nifi.sh script to start it bootstrap the NiFi process via the configuration in the bootstrap.conf NiFi configuration file. It is during the bootstrap process that NiFi starts the main child process that loads NiFi. Perhaps you can add additional java.args to handle your pre NiFi needs?
Or maybe modify the the nifi.sh script itself so that is executes your requirements before calling the rest of the NiFi startup process.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt