How IBM i Invokes Your System Startup Program

In dealing with several customers as of late, I realized that there seems to be some confusion as to exactly how and when IBM i invokes the system startup program that you have defined for your system.

As many of you know, there is a system startup program defined in system value QSTRUPPGM that you can display using command DSPSYSVAL SYSVAL(QSTRUPPGM) and it will give you this result:

The above example shows the native (base) IBM i operating system startup program QSTRUP in library QSYS being used as the startup program, but you can of course use any custom program that you have in any library.  Most IBM i installations have custom Control Language programs that they have written that start their environments, and you most likely do as well.  But “how” exactly does this system startup program get called and specifically “when”?

The system startup program by the widest possible definition gets called whenever the QCTL controlling subsystem is started, which will be one of the following two scenarios:

  • When the system is IPL’d
  • When the system is in a restricted state and is brought out of a restricted state by the issuance of the STRSBS SBSD(QCTL) command

Now from a system work management perspective, “how” does the startup program get called?  This is accomplished by the use of an Autostart Job Entry in the QCTL subsystem description.  If you display the QCTL subsystem description on your system using the command DSPSBSD SBSD(QCTL) and take option #3 (“Autostart job entries”), you will see this entry:

Because of this job entry, which is the system shipped default configuration, whenever the QCTL controlling subsystem is started, a job named QSTRUPJD will be started in the subsystem using job description QSTRUPJD in library QSYS.  If you display the QSTRUPJD job description using the command DSPJOBD JOBD(QSTRUPJD) and page down to see the “Request data” entry you will notice that system program QSYS/QWDAJPGM is being called:

What the QWDAJPGM does is critical, it directly calls the system startup program that you have defined in system value QSTRUPPGM.  This job description is why you see a batch job named QSTRUPJD running in QCTL calling program QWDAJPGM after every IPL or after you bring your system out of a restricted state.  Also worthy of note here, the QSTRUPJD job description also specifies what user profile to use when running the system startup program, the shipped default is QPGMR as shown in the screenshot below, but you can change it to use another profile if necessary.

Now, what if you want to IPL your system and you do not want the controlling subsystem to start thus not call the system startup program?  This can be easily accomplished by using the CHGIPLA (Change IPL Attributes) and specifying the system to “start to restricted state” by specifying the command CHGIPLA STRRSTD(*YES) which will result in your system being in a restricted state after the IPL is complete.  Note that the CHGIPLA STRRSTD(*YES) setting only persists through one IPL after which it is automatically set back to CHGIPLA STRRSTD(*NO) so the IPL following the restricted state IPL will be a normal IPL where the QCTL subsystem is started and the system startup program is called.  Another way to configure your system to start without the system startup program being run is to temporarily change the QSTRUPPGM system value to *NONE which will result in the QCTL controlling subsystem being started but no system startup program will be called.

 

More From This Month:

Leave a Comment

Your email address will not be published. Required fields are marked *