Skip to content

[BUG]install_sc_tcpsvr exits prematurely due to misplaced exit in oopsies() #236

Description

@T-SATAKESSL25

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions