The pieces required for the K3S-Silverswitch deployment are listed below.
First, your Presto instance must be installed into the library K3S_PRESTO (not the default XL_PRESTO when you run XL_PRESTOI/BCDINSTALL). You will have to run the install twice to accomplish this. Next, you need to edit the httpd.conf file in the IFS located in /www/k3s_presto/conf/ Change the top line to read: Listen 8035 (or Listen 80 if you do not use your iSeries as a web server) As a one time step, you will need to use command WRKLNK and copy /esdi/K3S_PRESTO/javascript/K3S_config.js to /esdi/K3S_config.js You will need to run the following command before compiling K3S_RESTOR for the first time: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132) You will also need to create save file K3S_PRSAVF before running the deployment script for the first time: CRTSAVF FILE(QGPL/K3S_PRSAVF) Note that all programs should reside in QGPL/QCLSRC. After creating the programs described below, use WRKJOBSCDE to create a scheduled job to automatically pull the updates on a regular basis. We recommend calling this job K3S_5UPDPR and setting it to run weekly on Friday mornings. This job will need to perform a call to K3S_PRSGET. Lastly, you must ensure that the following fields in the K_USERPRF file are set accordingly for all buyers: US_DATFMT = *USA (this is required to make the pop-up date calendars work correctly) US_DATESIX = 0 (this is required for date entry into the pop-up calendars to work correctly) CLP program K3S_PRSGET PGM OVRDBF FILE(INPUT) TOFILE(QGPL/QCLSRC) MBR(K3S_PRSIN) OVRDBF FILE(OUTPUT) TOFILE(QGPL/QCLSRC) MBR(K3S_PRSOUT) FTP RMTSYS('FTP.K3S.COM') CALL PGM(QGPL/K3S_RESTOR) ENDPGM CLP program K3S_RESTOR (before compiling this program you will need to run the following command: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132)) PGM /* DO BEFORE: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132) */ DCLF FILE(QGPL/K3S_ACTJOB) RCDFMT(K3S_ACTJOB) DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10) DCL VAR(&USERNAME) TYPE(*CHAR) LEN(10) DCL VAR(&JOBNUM) TYPE(*CHAR) LEN(6) /*--- END THE PRESTO RELATED JOBS ----------------------------------*/ ENDSBS SBS(EXODUS51) OPTION(*IMMED) MONMSG MSGID(CPF1054) MONMSG MSGID(CPF1055) ENDTCPSVR SERVER(*HTTP) HTTPSVR(K3S_PRESTO) MONMSG MSGID(TCP1A77) ENDTCPSVR SERVER(*WEBFACING) /* END PRESTO JOBS IN QCMN */ CALL PGM(QGPL/K3S_ENDQCM) /* END PRESTO JOBS IN QUSRWRK */ OVRPRTF FILE(QPDSPAJB) OUTQ(QEZJOBLOG) WRKACTJOB OUTPUT(*PRINT) SBS(QUSRWRK) JOB(K3S_PRESTO) CPYSPLF FILE(QPDSPAJB) TOFILE(K3S_ACTJOB) SPLNBR(*LAST) READ: RCVF RCDFMT(K3S_ACTJOB) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(WAIT)) IF COND(%SST(&K3S_ACTJOB 4 9) *EQ K3S_PRESTO) + THEN(DO) CHGVAR VAR(&JOBNAME) VALUE(%SST(&K3S_ACTJOB 4 10)) CHGVAR VAR(&USERNAME) VALUE(%SST(&K3S_ACTJOB 17 10)) CHGVAR VAR(&JOBNUM) VALUE(%SST(&K3S_ACTJOB 29 6)) ENDJOB JOB(&JOBNUM/&USERNAME/&JOBNAME) OPTION(*IMMED) ENDDO GOTO CMDLBL(READ) WAIT: DLYJOB DLY(40) /*--- REPLACE K3S_PRESTO LIB WITH THE FRESH ONE ---------*/ DLTDTAQ DTAQ(K3S_PRESTO/PR_CONVQ) MONMSG MSGID(CPF2105) RSTOBJ OBJ(PR_DEPLOY) SAVLIB(QGPL) DEV(*SAVF) + SAVF(QGPL/K3S_PRSAVF) ALWOBJDIF(*OWNER) MONMSG MSGID(CPF3773) RSTLIB SAVLIB(K3S_PRESTO) DEV(*SAVF) + SAVF(QGPL/PR_DEPLOY) MONMSG MSGID(CPF3773) /*--- RESTORE THE PRESTO IFS DIRECTORY ---------*/ RST DEV('/QSYS.LIB/K3S_PRESTO.LIB/PR_IFS.FILE') + OBJ(('/ESDI/K3S_PRESTO*')) SUBTREE(*ALL) + ALWOBJDIF(*ALL) MONMSG MSGID(CPF383E) /*--- RESTORE MODIFIED STUFF ---------*/ CPY OBJ('/esdi/K3S_config.js') + TOOBJ('/esdi/K3S_PRESTO/javascript/K3S_config.js') + REPLACE(*YES) /*--- START UP EXODUS SUBSYSTEM ---------*/ STRSBS SBSD(XL_EX51/EXODUS51) /*--- START UP PRESTO APACHE INSTANCE ---------*/ STRTCPSVR SERVER(*HTTP) HTTPSVR(K3S_PRESTO) MONMSG MSGID(TCP1A77) STRTCPSVR SERVER(*WEBFACING) /*-----------------------------------------------------------------*/ K3S_FINAL: ENDPGM CLP program K3S_ENDQCM PGM /* DO BEFORE: CRTPF FILE(QGPL/K3S_ACTJOB) RCDLEN(132) */ DCLF FILE(QGPL/K3S_ACTJOB) RCDFMT(K3S_ACTJOB) DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10) DCL VAR(&USERNAME) TYPE(*CHAR) LEN(10) DCL VAR(&JOBNUM) TYPE(*CHAR) LEN(6) DCL VAR(&MSG) TYPE(*CHAR) LEN(100) /* ************************************************************* */ /* END PRESTO JOBS IN QCMN */ OVRPRTF FILE(QPDSPAJB) OUTQ(QEZJOBLOG) WRKACTJOB OUTPUT(*PRINT) SBS(QCMN) JOB(EXODUS51) CPYSPLF FILE(QPDSPAJB) TOFILE(K3S_ACTJOB) SPLNBR(*LAST) READ1: RCVF RCDFMT(K3S_ACTJOB) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(WAIT1)) IF COND(%SST(&K3S_ACTJOB 4 6) *EQ EXODUS51) + THEN(DO) CHGVAR VAR(&JOBNAME) VALUE(%SST(&K3S_ACTJOB 4 10)) CHGVAR VAR(&USERNAME) VALUE(%SST(&K3S_ACTJOB 17 10)) CHGVAR VAR(&JOBNUM) VALUE(%SST(&K3S_ACTJOB 29 6)) ENDJOB JOB(&JOBNUM/&USERNAME/&JOBNAME) OPTION(*IMMED) ENDDO GOTO CMDLBL(READ1) WAIT1: DLYJOB DLY(1) /* ************************************************************* */ ENDPGM TXT member K3S_PRSIN user id password bin get k3s_prsavf (replace quit TXT member K3S_PRSOUT (just put 1 blank line in the member) |