Running Kaspersky Scan Engine in ICAP mode with the init script

You can run Kaspersky Scan Engine in ICAP mode by using the kavicapd service init script located in the %service_dir%/etc/init.d directory. The init script allows you to run the service manually from the command line or add it as a startup script.

Preparing the init script

By default, the kavicapd init script searches for the kavicapd executable file in the /opt/kaspersky/ScanEngine/bin directory. If you want to use the kavicapd service from another location, edit the init script accordingly. The DAEMON_DIR variable in the kavicapd script defines the path to the kavicapd executable file.

To prepare the kavicapd init script:

  1. Open the kavicapd.sh script for editing.
  2. Specify paths to plugins and libraries.
  3. Locate the following code:

    ########## ICAP service configuration ##########

    DAEMON_DIR="${SDKPATH}/bin"

    DAEMON="${DAEMON_DIR}/kavicapd"

    PIDFILE=/var/run/kavicapd.pid

    CONFILE=/etc/kavicapd.xml

  4. If required, manually set the value of the DAEMON_DIR variable to the kavicapd executable file location.
  5. Set the value of the PIDFILE variable to the kavicapd PID file location.

    If the PID file does not exist, the process initiated by the kavicapd.sh script will create it.

  6. Set the value of the CONFILE variable to the ICAP mode configuration file location.
  7. Locate the following line:

    STATUS_FILE_PATH=/tmp/kavicapd

  8. Set the value of the STATUS_FILE_PATH variable to the directory that will contain the status file of the kavicapd service.

    The value of this variable must be the same as the value of TempPath in the ICAP mode configuration file.

  9. Locate the following line:

    UPDATE_SIGNAL="USR1"

  10. Set the value of the UPDATE_SIGNAL variable to the signal that will be used to update and reload the database (updatedb command).

    Specify USR1 to use SIGUSR1, or USR2 to use SIGUSR2.

    If the kavicapd service receives a USR signal (SIGUSR1 or SIGUSR2) that is not specified in this parameter, the service stops (this is the default behavior of Linux programs). Consider this behavior when specifying a value for this parameter.

  11. Save the file and close the editor.

Running the service with the init script

The kavicapd.sh init script supports the following commands:

To see the list of supported commands, execute the script without any parameters.

[user@host ~]$ /etc/init.d/kavicapd

Running the service automatically

To start the service automatically, make kavicapd a startup service.

To make kavicapd a startup service:

  1. Copy the kavicapd.sh init script to the directory that contains init scripts. The location of this directory may vary depending on the operating system.
  2. Add the kavicapd service to the service startup list. The exact method may vary depending on the operating system.
  3. Verify that the service has been added successfully.
  4. Restart the system for the changes to take effect.
Page top