Initializer script

Initialization script used to set necessary settings in ClamAV configuration file and correct permissions.

edeposit_clamd_init.REQUIRED_SETTINGS = {'MaxThreads': '2', 'LocalSocket': '/var/run/clamav/clamd.ctl', 'AllowSupplementaryGroups': 'true', 'ScanPE': 'true', 'FixStaleSocket': 'true', 'ReadTimeout': '180', 'LocalSocketMode': '666', 'LocalSocketGroup': '$groupname', 'ScanArchive': 'true', 'LogRotate': 'true', 'LogSyslog': 'false', 'User': '$username', 'LogTime': 'true', 'MaxConnectionQueueLength': '3', 'ScanELF': 'true', 'LogFile': '/var/log/clamav/clamav.log', 'PidFile': '/var/run/clamav/'}

All required settings is there, rest is not important.


Return username depending on type of system (deb/suse).


Set all configuration specified in REQUIRED_SETTINGS.

Parameters:configuration (str) – Configuration file content.
Returns:Updated configuration.
Return type:str
edeposit_clamd_init.create_config(cnf_file, uid, overwrite)[source]

Creates configuration file and the directory where it should be stored and set correct permissions.

  • cnf_file (str) – Path to the configuration file.
  • uid (int) – User ID - will be used for chown.
  • overwrite (bool) – Overwrite the configuration with CLEAN_CONFIG.
edeposit_clamd_init.create_log(log_file, uid)[source]

Create log file and set necessary permissions.

  • log_file (str) – Path to the log file.
  • uid (int) – User ID - will be used for chown.

Return name of the daemon depending on the system type.

edeposit_clamd_init.main(*args, **kwargs)[source]

Create configuration and log file. Restart the daemon when configuration is done.

  • conf_file (str) – Path to the configuration file.
  • overwrite (bool) – Overwrite the configuration file with clean config?


$ ./ -h
usage: [-h] [-v] [-o] [-c CONFIG]

edeposit.amqp.antivirus ClamAV initializer.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Print logging messages.
  -o, --overwrite       Overwrite default configuration file. Don't worry,
                        your original file will be stored in backup_.
  -c CONFIG, --config CONFIG
                        Path to the configuration file. Default