From f1a52aad91ec94e56d5207c84c61219593d10ad2 Mon Sep 17 00:00:00 2001 From: Russell Tweed Date: Tue, 6 Mar 2018 21:55:27 +0000 Subject: [PATCH] Add check to ClamAV task to prevent simeltaneous content updates Check to see if a freshclam process is already running before kicking off another; attempting a second update will fail if one is already in progress. Change-Id: Id5ab344c2408ba64c58612bab33c2ee98aeb97d5 Closes-Bug: 1730998 --- tasks/rhel7stig/misc.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/rhel7stig/misc.yml b/tasks/rhel7stig/misc.yml index 8e9975d9..56203d61 100644 --- a/tasks/rhel7stig/misc.yml +++ b/tasks/rhel7stig/misc.yml @@ -182,10 +182,20 @@ - misc - V-72213 +- name: Check if ClamAV update process is already running + shell: "ps -ef | egrep [f]reshclam -q" + register: freshclam_proc + changed_when: False + failed_when: False + check_mode: no + tags: + - always + - name: Update ClamAV database command: freshclam changed_when: False when: + - freshclam_proc.rc != 0 - clamav_install_check.stat.exists - security_enable_virus_scanner | bool - security_run_virus_scanner_update | bool