Automatically starting Orion

I wanted to automatically start Orion at system start up plus allow the start and end from a normal IBM i command line. My initial thoughts was to use a command and CLP which would start and stop Orion using the same scripts that were called from QP2TERM etc. I first added a direct call from the QSTRUPPGM using the script and did an IPL, the program failed to start and I found out that there was an authority problem. I did not want to mess around giving QPGMR (QSTRUP program runs under this profile on startup) to the scripts directly but then realized other objects could be touched that would also need authority set to QPGMR.

Here is the command I originally tried.
QSH   CMD('exec /QOpenSys/QIBM/ProdData/OPS/Orion/orion') 

I wanted to make this very simple so the idea of having a command based call in QSTRUP seemed to be the way to go. I created a CLP with the above request in and a front end command, when I ran it from the command line it worked but always through up a standard output message about needing to be run a QTMHHTTP and that it would be submitted automatically for me. I built the CLP with adopted authority of *OWNER and added it into the QSTRUP program. After the IPL there was still no Orion jobs running in the HTTP subsystem!

I checked the joblog and nothing looked out of place, the authority issues had gone away but still no program start. I then looked at the orion script which is used to start it up as per IBM’s instructions. This gave me a clue, when the script is called it checks if it is running as QTMHHTTP and if not submits a job to do so (its a submitted job calling itself). So I simply took that part of the code and added it to my CLP, compiled the program and set the authority to *OWNER again. After I IPL’d Orion was successfully started.

Here is the final code for the call to the command in QSTRUP,
             ADDLIBLE   LIB(SASLIB)              
             MONMSG     MSGID(CPF2103)           
             RMVLIBLE   LIB(SASLIB)              
             MONMSG     MSGID(CPF2104 CPF2110)   
The command is pretty straight forward as it takes no parameters and simply fronts ends the following CLP

             MONMSG     MSGID(CPF0000)                                 

             SBMJOB     CMD(QSH CMD('exec +                            
                          /QOpenSys/QIBM/ProdData/OPS/Orion/orion')) + 
                          JOB(QORION) JOBD(QHTTPSVR/QZHBHTTP) +        
                          OUTQ(*USRPRF) USER(QTMHHTTP) +               
                          RTGDTA(HTTPWWW) SYSLIBL(*SYSVAL) +           
                          CURLIB(*USRPRF) INLLIBL(*JOBD) +             
                          CCSID(*USRPRF) ALWMLTTHD(*YES)               
That’s all there was to it. This information was posted in the Ryver forums as well for those who are following the discussion there. I have added it here for those who do not.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.