Versions Compared

Key

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

...

Tip
titleReset Zend Server environment periodically using a CL Program

If you want to automate a process to periodically do the Reset, you can use this CL program in a scheduled job.  You will need to stop the Zend Server Environment before running this procedure.  If you are using Zend Server 9.1.x - 2019.x, Please REPLACE all instances of zendphp74 with zendphp7. If you are using Zend Server 6 - 8.5.x, Please REPLACE all instances of zendphp7 zendphp74 with zendsvr6

For Zend Server with PHP 7202.x and higher
ENDSBS ZENDPHP7ZENDPHP74/ZENDPHP7ZENDPHP74
ENDTCPSVR SERVER(*HTTP) HTTPSVR(ZENDPHP7ZENDPHP74)
MONMSG MSGID(CPF0000)


Reset Zend Server environment:


PGM

DCL VAR(&CMDSHR) TYPE(*CHAR) LEN(50)
DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
DCL VAR(&HOMEDIR) TYPE(*CHAR) LEN(50) +
VALUE('/usr/local/zendphp7zendphp74')

/* Part 1 - clean up zombie Apache jobs */
CHGVAR VAR(&CMDSHR) VALUE('ps -ef | grep ' *CAT +
'/zendphp7zendphp74/bin/php-cgi ' *CAT ' | awk '{print $2}' | +
xargs kill -9' || &NULL)

CALL PGM(QP2SHELL) PARM('/QOpenSys/usr/bin/sh' +
&CMDSHR)
MONMSG MSGID(CPF0000)
/* Part 2 - Clearing shared memory */

/*parameters : script, tofile, look for string, status */
CHGVAR VAR(&CMDSHR) VALUE(&HOMEDIR *TCAT +
'/bin/i5ipcrm_script.sh' || &NULL)
CALL PGM(QP2SHELL) PARM('/QOpenSys/usr/bin/sh' +
&CMDSHR)
MONMSG MSGID(CPF0000)

CHGVAR VAR(&CMDSHR) VALUE(&HOMEDIR *TCAT +
'/bin/clean_tmpfiles.sh' || &NULL)

CALL PGM(QP2SHELL) PARM('/QOpenSys/usr/bin/sh' +
&CMDSHR)
MONMSG MSGID(CPF0000)

ENDPGM

...