Skip to content

checkServer

checkServer#

About checkServer#

Monitors the Altibase process and, if Altibase terminates, executes a script specified by a user.

checkServer [-n] {-f server-restart-script-file}

Syntax#

checkserver

Parameters#

Parameter Description
-n Specifies that checkServer is to be executed in the foreground. If this parameter is omitted, checkServer will be executed in the background
-f The name of the script file to be executed when Altibase terminates

Description#

checkServer periodically checks whether the Altibase process is running. If checkServer detects that Altibase has terminated, it executes the script specified by a user. It is common to set an Altibase restart script to be executed in the event of termination. Such a restart script can be written as follows:

  • The Altibase starup script 'restart.sh'

    #! /bin/sh
    ${ALTIBASE_HOME}/bin/server start
    

When checkServer is executed, it creates the files checkServer.pid and checkServer.log in the $ALTIBASE_HOME/trc directory. checkServer.pid is a kind of lock that prevents another instance of checkServer from being started while the current instance is running. checkServer.log is used to regularly record the status of checkServer.

If checkServer is terminated abnormally, for example by using the command kill -9, the checkServer.pid file will not be deleted from the $ALTIBASE_HOME/trc directory. As long as this file remains in that directory, it will prevent checkServer from being executed again.

To terminate checkServer normally, use the killcheckServer utility

Note#

checkServer executes the specified restart script only when the Altibase server is shut down without using the server stop command. When the Altibase server is shut down normally using server stop, checkServer is also terminated, and thus does not execute the restart script. That is, checkServer only considers shutdown using the server stop command to be a normal shutdown.

Example#

checkServer is executed from a shell prompt as follows:

$ checkServer -f restart.sh &