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:
kavicapd.sh script for editing.########## ICAP service configuration ########## DAEMON_DIR="${SDKPATH}/bin" DAEMON="${DAEMON_DIR}/kavicapd" PIDFILE=/var/run/kavicapd.pid CONFILE=/etc/kavicapd.xml |
DAEMON_DIR variable to the kavicapd executable file location.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.
CONFILE variable to the ICAP mode configuration file location.STATUS_FILE_PATH=/tmp/kavicapd |
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.
UPDATE_SIGNAL="USR1" |
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.
Running the service with the init script
The kavicapd.sh init script supports the following commands:
start—Start the kavicapd service.After this command is executed, the script prints [OK] and immediately returns control to the terminal, but it takes the service some time to start.
stop—Stop the kavicapd service.restart—Restart the kavicapd service (that is, stop and then start the service).After this command is executed, the script prints [OK] and immediately returns control to the terminal, but it takes the service some time to start.
updatedb—Send a SIGUSR1 or SIGUSR2 signal (as specified in the UPDATE_SIGNAL parameter of the init script) to the kavicapd service. The kavicapd service handles this signal either by reloading or by updating and then reloading the database, as specified in the ICAP mode configuration file.
status—Show the status of the kavicapd service.Status message contains the following information:
Following is an example of the status command output in simplified licensing mode:
kavicapd (pid 1107) is running... KAV SDK version: KAV SDK v8.5.1.83 ICAPD version: KL ICAP Service v1.0 (KAV SDK v8.5.1.83) Database release date: 2015-Sep-14 07:46:00 Records in the database: 4308101 Key file name: EXAMPLE.key Key file expiration date: 2019-Jan-12 20:00:00 Days left: 590 |
Following is an example of the status command output in online licensing mode.
|
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:
kavicapd service to the service startup list. The exact method may vary depending on the operating system.