Bug Description
The oopsies() function in strtcpsvr/install_sc_tcpsvr contains
an exit 5 statement before the cleanup code, causing the script
to exit immediately on any error without completing the installation.
Code (current)
oopsies() {
echo ''
echo ''
exit 5 # ← exits here, never reaches ADDTCPSVR
echo 'Cleaning up from error...'
...
}
Impact
When CHGOBJOWN OBJ(SCOMMANDER/SC) OBJTYPE(*PGM) NEWOWN(QSYS) CUROWNAUT(*REVOKE) fails, oopsies is called and the script
exits before running ADDTCPSVR, so *SC is never registered.
Workaround
Manually run the remaining commands after the script fails:
system "CHGAUT OBJ('/qsys.lib/SCOMMANDER.lib/sc.pgm') USER(*PUBLIC) DTAAUT(*EXCLUDE) OBJAUT(*NONE)"
system "CHGAUT OBJ('/qsys.lib/SCOMMANDER.lib/sc.pgm') USER(QTCP) DTAAUT(*X) OBJAUT(*NONE)"
system "ADDTCPSVR SVRSPCVAL(*SC) PGM(SCOMMANDER/SC) SVRNAME(SC) SVRTYPE(SC) AUTOSTART(*YES) TEXT('Service Commander')"
Suggested Fix
Move exit 5 to after the cleanup code in oopsies().
Bug Description
The
oopsies()function instrtcpsvr/install_sc_tcpsvrcontainsan
exit 5statement before the cleanup code, causing the scriptto exit immediately on any error without completing the installation.
Code (current)
Impact
When
CHGOBJOWN OBJ(SCOMMANDER/SC) OBJTYPE(*PGM) NEWOWN(QSYS) CUROWNAUT(*REVOKE)fails,oopsiesis called and the scriptexits before running
ADDTCPSVR, so*SCis never registered.Workaround
Manually run the remaining commands after the script fails:
Suggested Fix
Move
exit 5to after the cleanup code inoopsies().