LoginSignup
0
1

More than 5 years have passed since last update.

ClamAVをデーモン化する(CentOS7)

Posted at

ClamAVをデーモン化する必要がでてきたのでwebで調べてみると「Clamdをインストールしろ」、「ClamdはRepoForgeからゲットできるぞ!」といった記事がたくさん出てくる。ということでさっそくインストールしてみる。

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm && yum -y install clamd

・・・?
インストールできない??
repoforgeにアクセスできない???
サーバが落ちてるのか????

~~次の日~~

まだ落ちてる・・・

~~さらに次の日~~

アクセスできない!!

ちょっと調べてみると以下のような衝撃な事実が。
RPMForge/RepoForge - This is a dead project. Not maintained. DO NOT USE.
https://wiki.centos.org/AdditionalResources/Repositories

まじかよ。どうしよう。

ということでClamAVをデーモン化する方法を調べたので手順を書き残しておきます。

ここから本題

まずClamAVをインストールします。CentOS7ではClamAVはepel-releaseというリポジトリから入手できるので、こっちもインストールします。

yum -y install epel-release && yum -y install clamav

デーモン化するにはもう一つインストールします。

yum -y install clamav-scanner-systemd

インストールすると以下のコンフィグが作成されるのでコイツを編集します。

vi /etc/clamd.d/scan.conf

とりあえず冒頭のExampleをコメントアウトします(そのほかの設定は適宜)

# Comment or remove the line below.
#Example

サービスが自動起動するようにしておきます。

systemctl enable clamd@scan.service

サービスを起動します。

systemctl restart clamd@scan.service

なお、データべースの更新にはclamav-updateをインストールすればfreshclamが使えるようになります。
freshclamはcronで定期実行してもよいですが、freshclam -dとすればデーモンで起動することができます。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1