Skip to content

Commit

Permalink
Sleep before clamdscan test
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Apr 28, 2017
1 parent 37bd948 commit 3381e05
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Virtualmin/Config/Plugin/ClamAV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ sub actions {

# Start clamd@scan and run clamdscan just to prime the damned thing.
# XXX Make this work on Debian/Ubuntu, too.
system("systemctl start clamd\@scan");
sleep 10; # XXX THis is ridiculous. But, clamd is ridiculous.
system('systemctl start clamd@scan');
sleep 30; # XXX THis is ridiculous. But, clamd is ridiculous.
my $res = `clamdscan --quiet --config-file=/etc/clamd.d/scan.conf /etc/webmin/miniserv.conf`;
system('systemctl stop clamd@scan');
# If RHEL/CentOS/Fedora, the clamav packages don't work, by default.
if ( ! -e '/etc/clamd.conf' ) {
eval { symlink('/etc/clamd.d/scan.conf', 'etc/clamd.conf');
}
if ($res) { die 1; }
system("systemctl stop clamd\@scan");
$self->done(1); # OK!
};
if ($@) {
Expand Down

0 comments on commit 3381e05

Please sign in to comment.