Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Issue

After ending the ZENDSVR6 ZENDPHP7 Apache instance (or ZENDSVR6 for Zend Server versions 6 - 8.5.x or ZENDSVR for Zend Server version 5), the Apache instance cannot be restarted.  Looking in the QHTTPSVR subsystem, there are one or more jobs named ZENDSVR6 ZENDPHP7 active with the function 'PGM-php-cgi.bi' running.  An example scenario would be a back up routine that ends the ZENDSVR6 ZENDPHP7 Apache instance for the duration of the back up, then fails to start the ZENDSVR6 ZENDPHP7 Apache instance after the back up completes.

Environment

Any version of Zend Server running on any supported version of IBM i.

Please Note:  For Zend Server 6 - 8.5.x , use ZENDSVR6 instead of ZENDPHP7 and for Zend Server 5, use ZENDSVR instead of ZENDSVR6 in the examplesZENDPHP7.

Resolution

This procedure uses an example utility called ENDUSRJOB.  You can find it here:

...

Consider a batch job that does a back up. During the back up, the ZENDSVR6 ZENDPHP7 Apache instance should not be running. After the back up, if there are an any left over ZENDSVR6 ZENDPHP7 batch jobs still running, it will not be possible to start the ZENDSVR6 ZENDPHP7 Apache instance.

Here is how you might use a utility like ENDUSRJOB to help insure there are no leftover jobs.

In your batch program, you could use a command like this to end Zend Server:

Info
iconfalse

ADDLIBLE ZENDSVR6 ZENDPHP7
CALL ZENDSVR6ZENDPHP7/ZENDSBS

This should end the ZENDSVR6 ZENDPHP7 subsystem, and also end the ZENDSVR6 ZENDPHP7 Apache instance. Then you could wait a couple of minutes for a normal shutdown to complete:

...

Then, shut down any remaining ZENDSVR6 ZENDPHP7 Apache jobs with the *IMMED option:

Info
iconfalse
ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVR6ZENDPHP7) OPTION(*IMMED)

This will issue an ENDJOB *IMMED for any ZENDSVR6 ZENDPHP7 Apache job still running.

...

After the back up, restart the ZENDSVR6 ZENDPHP7 subsystem and Apache instance:

Info
iconfalse

ADDLIBLE ZENDSVR6 ZENDPHP7
CALL ZENDSVR6ZENDPHP7/ZSTRSBS

If the jobs will not end in a reasonable amount of time even when the ENDJOB *IMMED is tried, you can try using ENDJOBABN, by using the OPTION(*ABN) parameter. The ENDJOBABN command cannot be run for a job until at least 10 minutes after the job has gone into end immediate status, which happens when you do an ENDJOB *IMMED, or the wait time expires on an ENDJOB *CNTRLD. So you could do something like this:

Info
iconfalse
ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVR6ZENDPHP7) OPTION(*IMMED)
DLYJOB DLY(600)
ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVRZENDPHP7) OPTION(*ABN)

Instead of doing the 10 minute delay job, you could possibly proceed with the back up (if the back up is while active), then do the ENDJOBABN after, assuming the back up takes at least 10 minutes.