How to perform specific actions when starting an InterSystems product
InterSystems FAQ rubric
If you want to run an OS executable file, command, or a program created within an InterSystems product when the InterSystems product starts, write the processing in the SYSTEM^%ZSTART routine. (The %ZSTART routine is created in the %SYS namespace).
Before you write any code in SYSTEM^%ZSTART, make sure that it works properly under all conditions.
If the ^%ZSTART routine is written incorrectly, or if it is written correctly but the command does not return a response or an error occurs during processing, InterSystems products may not be able to start.
For more information, please refer to the following document.
About writing %ZSTART and %ZSTOP routines [IRIS]
About writing %ZSTART and %ZSTOP routines
Comments
One other thing to note is that you should not put any long running processes in %ZSTART as they will hold up the Start process.
If you have to, then consider JOBbing it off to a separate process, so it can run in the background and allow the rest of the startup steps to run in parallel.