Introduction

For Controller instances a Watchdog Script is provided that serves the purposes to

  • start and restart the Controller instance,
  • provide logging.

Watchdog Script

The Watchdog Script is provided for Unix and Windows. It is not used when operating the Controller instance from a Container or from a Windows Service.

The Watchdog Script is available from the following location:

  • Unix
    • <controller-home>/bin/controller_watchdog.sh
  • Windows
    • <controller-home>\bin\controller_watchdog.cmd

Starting Controller / Restarting Controller

Technically the Watchdog Script is used to start the Controller from its controller.sh|.cmd Start Script.

In the following situations the Watchdog Script will restart the Controller instance:

  • For the command line operation: controller.sh|.cmd restart
  • For the Terminate and Restart and Abort and Restart operations available from  the JOC Cockpit Dashboard view.


Logging

The Watchdog Script will capture output to stdout/stderr channels through the lifetime of a Controller instance.

Log output is stored to the <controller-data>/logs/watchdog.log file.

  • The log file reports the command line used to start the Controller instance.
  • The log file holds information about use of a JS7 - License.
  • The log file is an important source for analysis in case of problems:
    • Any warnings and errors that will not make it for Log4j logging are reported to the log file.
    • The same applies to warnings and errors that occur before the JVM is initialized and before Log4j logging can start, for example if an incomptible Java version is used when starting the Controller.

Watchdog Operation

Users can check from the processes used for the Controller instance that both Watchdog process and Controller process are running in parallel:

Example for display of Watchdog process and Controller process
-bash-4.2$ ps -ef  | grep '\-training'
sos      20602     1  0 Aug15 ?        00:00:00 /bin/sh /home/sos/training/controller/controller.home/bin/controller_watchdog.sh -training

-bash-4.2$ ps -ef | grep 9444
sos      20604 20602  1 Aug15 ?        02:28:50 /opt/java/jdk-21/bin/java -DJS7.Controller=training -Xmx256m -Djava.security.egd=file:///dev/urandom -Dfile.encoding=UTF-8 -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j2.asyncLoggerWaitStrategy=Block -classpath /home/sos/training/controller/controller.home/lib:/home/sos/training/controller/controller.home/var/config/patches/*:/home/sos/training/controller/controller.home/var/config/lib/*:/home/sos/training/controller/controller.home/lib/patches/*:/home/sos/training/controller/controller.home/lib/user_lib/*:/home/sos/training/controller/controller.home/lib/sos/*:/home/sos/training/controller/controller.home/lib/3rd-party/* js7.controller.ControllerMain --id=training --http-port=localhost:9444 --https-port=centostest_primary:9444 --config-directory=/home/sos/training/controller/controller.home/var/config --data-directory=/home/sos/training/controller/controller.home/var

If the Watchdog process is not available then this will affect operation of the Controller instance:

  • The Controller instance cannot be restarted when operated for Unix or Windows.
  • The Terminate and Restart and Abort and Restart operations available from  the JOC Cockpit Dashboard cannot be performed.

Besides the above effects the Controller instance will continue normal operation if the Watchdog process is not available.



  • No labels