Search code examples
oracle-databasebashshellpeoplesoft

Not able to send psadmin output to logs


I'm making a script to restart an instance and it works without any log file but it gives the following error when I try to log the output of psadmin:

java.lang.NullPointerException 
        at com.peoplesoft.pt.psadmin.ui.Progress.<init>(Progress.java:135) 
        at com.peoplesoft.pt.psadmin.ui.Progress.getInstance(Progress.java:123) 
        at com.peoplesoft.pt.psadmin.pia.DomainBootHandler.BootWlsServer(DomainBootHandler.java:84) 
        at com.peoplesoft.pt.psadmin.pia.DomainBootHandler.run(DomainBootHandler.java:62) 
        at com.peoplesoft.pt.psadmin.pia.PIAAdminCmdLine.startDomain(PIAAdminCmdLine.java:270) 
        at com.peoplesoft.pt.psadmin.pia.PIAAdminCmdLine.run(PIAAdminCmdLine.java:481) 
        at com.peoplesoft.pt.psadmin.PSAdmin.runSwitched(PSAdmin.java:170) 
        at com.peoplesoft.pt.psadmin.PSAdmin.main(PSAdmin.java:232)

The following works (with no log):

export ORAENV_ASK=NO
export ORACLE_SID=PSCNV
.oraenv
export TUXDIR=/m001/Oracle/Middleware/tuxedo12.1.1.0
. /m001/pt854/psconfig.sh
. $TUXDIR/tux.env
export PS_CFG_HOME=$PS_HOME

$PS_HOME/appserv/psadmin -w shutdown -d PSCNV
$PS_HOME/appserv/psadmin -w start -d PSCNV
$PS_HOME/appserv/psadmin -w status -d PSCNV

Changing the psadmin invocations like so causes the error:

LOGFILE=/home/psoft/scripts/pscnv_webserv_stopNstart.log
test() {
   $PS_HOME/appserv/psadmin -w shutdown -d PSCNV
   $PS_HOME/appserv/psadmin -w start -d PSCNV
   $PS_HOME/appserv/psadmin -w status -d PSCNV
}
test >> ${LOGFILE}

I also tried redirecting the output of each call individually and saw the same error.


Solution

  • This solved this for me. nohup script -q -c "psadmin -w start -d peoplesoft"