4 Replies Latest reply on Dec 18, 2019 4:44 AM by Parag Desai

    Type 3 NSH Script Job not working as expected

    Parag Desai
      Share This:

      TSSA 8903

       

      Job: NSH Script job to start a Tomcat instance

      NSH Script type: 3

       

      Command being run:

      now=$(date '+%s')

      /apps/tomcat/${app_name}/bin/startup.sh | tee -a /tmp/tomcat-App-operation.${now}.txt

       

      Results:

      The script when run manually on the server using NSH Here -> nexec bash, works absolutely fine. The tomcat instance starts.

      However, when run as NSH Script Job Type 3 using the same mapped user in the role, the script does NOT start, although the logs shows the tomcat instance started.

       

      Below is the excerpt of the log.

      Using CATALINA_BASE:   /apps/tomcat/TestTomcat

      Using CATALINA_HOME:   /apps/tomcat/TestTomcat

      Using CATALINA_TMPDIR: /apps/tomcat/TestTomcat/temp

      Using JRE_HOME:        /

      Using CLASSPATH:       /apps/tomcat/TestTomcat/bin/bootstrap.jar:/apps/tomcat/TestTomcat/bin/tomcat-juli.jar

      Using CATALINA_PID:    /apps/tomcat/TestTomcat/temp/catalina.pid

      Using CATALINA_BASE:   /apps/tomcat/TestTomcat

      Using CATALINA_HOME:   /apps/tomcat/TestTomcat

      Using CATALINA_TMPDIR: /apps/tomcat/TestTomcat/temp

      Using JRE_HOME:        /

      Using CLASSPATH:       /apps/tomcat/TestTomcat/bin/bootstrap.jar:/apps/tomcat/TestTomcat/bin/tomcat-juli.jar

      Using CATALINA_PID:    /apps/tomcat/TestTomcat/temp/catalina.pid

      Existing PID file found during start.

      Existing PID file found during start.

      Removing/clearing stale PID file.

      Removing/clearing stale PID file.

      Tomcat started.

      Tomcat started.

       

      Also, don't know why it is appending the messages twice.

       

      Is there something wrong with the job config? Please suggest.

       

      Thanks,
      Parag