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/clamd.pid'}¶ All required settings is there, rest is not important.
-
edeposit_clamd_init.
update_configuration
(configuration)[source]¶ 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.
Parameters:
-
edeposit_clamd_init.
create_log
(log_file, uid)[source]¶ Create log file and set necessary permissions.
Parameters:
-
edeposit_clamd_init.
get_service_name
()[source]¶ 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.
Parameters:
Usage¶
$ ./edeposit_clamd_init.py -h
usage: edeposit_clamd_init.py [-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
/etc/clamav/clamd.conf.