Can't restart Apache on the IBM i because of zombie ZENDSVR6 jobs in QHTTPSVR

Follow

Issue

After ending the ZENDSVR6 Apache instance (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 active with the function 'PGM-php-cgi.bi' running.  An example scenario would be a back up routine that ends the ZENDSVR6 Apache instance for the duration of the back up, then fails to start the ZENDSVR6 Apache instance after the back up completes.

Environment

Any version of Zend Server running on any supported version of IBM i.  For Zend Server 5, use ZENDSVR instead of ZENDSVR6 in the examples.

Resolution

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

End jobs on the IBM i by User and Job Name – ENDUSRJOB

You could also write your own utility to perform a similar function.  The principles discussed here would still apply.

Consider a batch job that does a back up. During the back up, the ZENDSVR6 Apache instance should not be running. After the back up, if there are an left over ZENDSVR6 batch jobs still running, it will not be possible to start the ZENDSVR6 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:

ADDLIBLE ZENDSVR6  
CALL ZENDSVR6/ZENDSBS

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

DLYJOB DLY(120)  

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

ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVR6) OPTION(*IMMED) 

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

Proceed with the back up.

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

ADDLIBLE ZENDSVR6  
CALL ZENDSVR6/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:

ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVR6) OPTION(*IMMED)  
DLYJOB DLY(600)
ENDUSRJOB USER(QTMHHTTP) JOBTYPE(*BATCH) JOBNAME(ZENDSVR) 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.

Have more questions? Submit a request

Comments

Powered by Zendesk