前回の続き。
迷いに迷って、さてさて。
なので、最初からインストールしてみた。(別のMacにね)
インストール時に色々とメッセージが出てくるが、しっかりきっちりと読み飛ばしていた。(^_^;;
clamav-serverっを入れるには、次の3点が必要だそうだ。
- clamav
- fswatch
- json-c
またruby27 @2.7.1もいると出た。2.7があるから放っておくことにした。(いいのかな?)
で、読み飛ばしていたのがココ。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
clamav-server is installed to perform three types of operations. 1. Basic clamd server and freshclam updates are controlled by their respective launchdaemons and configuration files: /opt/local/etc/clamd.conf /opt/local/etc/freshclam.conf Clamav database initialization/refresh is performed with the command: sudo freshclam Quarantined files are moved to the directory defined by the shell variable ${CLAMAV_SERVER_QUARANTINE}, with default /opt/Quarantine: ${CLAMAV_SERVER_QUARANTINE:-/opt/Quarantine}. 2. Clamav Scan-On-Demand is performed with the command: /opt/local/bin/ClamavScanIt.sh file1 [directory1] [file2 ...] A Finder.app Contextual Menu applies ClamavScanIt.sh to the selected items in Finder.app. Add this menu item with the command: cp -R /opt/local/share/clamav/ClamavScanIt.workflow ~/Library/Services open -a Automator ~/Library/Services/ClamavScanIt.workflow \ && osascript -e 'quit app "Automator"' Configure this service using: System Preferences> Keyboard> Shortcuts> Services> Files and Folders> ClamavScanIt 3. On-Schedule and On-Access scanning. On-Access scans are performed on all user ~/Downloads and ~/Desktop directories. Scheduled scans are performed on all targets in the bash list $CLAMAV_SERVER_SCAN_SCHEDULE_TARGETS[@], whose default is: CLAMAV_SERVER_SCAN_SCHEDULE_TARGETS=("/") On macOS 10.14+ On-Schedule and On-Access scans require enabling Full Disk Access for the MacPorts process "daemondo" in: System Preferences> Security & Privacy> Full Disk Access Startup items (named 'ClamavScanOnAccess, freshclam, clamd, ClamavScanSchedule') have been generated that will aid in starting clamav-server with launchd. They are disabled by default. Execute the following command to start them, and to cause them to launch at startup: sudo port load clamav-server |
よく判らないのでGoogle先生に翻訳して貰った。(一部コマンドは戻した)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
clamav-serverは、3種類の操作を実行するためにインストールされます。 1.基本的なclamdサーバーとfreshclamの更新は、それらによって制御されます それぞれのlaunchdaemonsと構成ファイル: /opt/local/etc/clamd.conf /opt/local/etc/freshclam.conf Clamavデータベースの初期化/更新は、次のコマンドで実行されます。 sudo freshclam 隔離されたファイルは、シェルによって定義されたディレクトリに移動されます 変数$ {CLAMAV_SERVER_QUARANTINE}がデフォルト /opt/Quarantine: $ {CLAMAV_SERVER_QUARANTINE:-/opt/Quarantine}。 2. Clamav Scan-On-Demandは、次のコマンドで実行されます。 /opt/local/bin/ClamavScanIt.sh file1 [directory1] [file2 ...] Finder.appコンテキストメニューは、選択したものにClamavScanIt.shを適用します Finder.appのアイテム。次のコマンドでこのメニュー項目を追加します。 cp -R /opt/local/share/clamav/ClamavScanIt.workflow ~/Library/Services open -a Automator ~/Library/Services/ClamavScanIt.workflow && osascript -e 'quit app "Automator"' 以下を使用してこのサービスを構成します。 [システム環境設定]> [キーボード]> [ショートカット]> [サービス]>ファイルとフォルダー> ClamavScanIt 3.オンスケジュールおよびオンアクセススキャン。オンアクセススキャンはで実行されます すべてのユーザー〜/ダウンロードおよび〜/デスクトップディレクトリ。スケジュールされたスキャンは bashリスト内のすべてのターゲットで実行 $ CLAMAV_SERVER_SCAN_SCHEDULE_TARGETS [@]、デフォルトは次のとおりです。 CLAMAV_SERVER_SCAN_SCHEDULE_TARGETS =( "/") macOS 10.14+では、オンスケジュールおよびオンアクセススキャンを有効にする必要があります MacPortsプロセス「daemondo」のフルディスクアクセス: システム環境設定>セキュリティとプライバシー>フルディスクアクセス スタートアップアイテム(名前は 'ClamavScanOnAccess、freshclam、clamd、 開始に役立つClamavScanSchedule ')が生成されました clamav-serverdを使用したサーバー。これらはデフォルトで無効になっています。を実行します 次のコマンドを使用してそれらを起動し、起動時に起動させます。 sudo port load clamav-server |
ここでやらなければいけないことが判った。
先ず、
|
1 2 |
cp -R /opt/local/share/clamav/ClamavScanIt.workflow ~/Library/Services open -a Automator ~/Library/Services/ClamavScanIt.workflow && osascript -e 'quit app "Automator"' |
をターミナルにコピペする。

すると、[システム環境設定]> [キーボード]> [ショートカット]> [サービス]>ファイルとフォルダーにClamavScanItが追加された。
daemondoは自力で追加した。
|
1 2 3 |
% where daemondo /opt/local/bin/daemondo |
で場所を探し、システム環境設定>セキュリティとプライバシー>フルディスクアクセスで追加の+ボタンを叩く、ファイルを選択のところで、⌘+shift+Gで直接入力「/opt/local/bin/daemondo」で選ぶ。

これできっと動くだろう。(そう思いたい)
で、最後に、
|
1 |
sudo port load clamav-server |
後はClamavScanScheduleが動けば定期チェックができるのだろう。
探してみた。
Googleさん経由で、MacPortsのGitHub、clamav-server/Portfileに辿り着く。
このページで、「ClamavScanSchedule」を検索する。
clamd.confを読んでいるらしい。とか、
|
1 |
{( echo "Launchdaemon org.macports.ClamavScanOnAccess started on $(${DATE[@]}) …" ; echo "Watched directories:" ) >> "${CLAMAV_SERVER_SCAN_ONACCESS_LOG}"} |
からLaunchDaemonにplistが存在するらしいとか判った。
/Laibrary/LaunchDaemonにClamAC関係が4つ増えていた。全部linkファイルだね〜。
|
1 2 3 4 |
/Library/LaunchDaemons/org.macports.ClamSMTP.plist@ /Library/LaunchDaemons/org.macports.ClamavScanOnAccess.plist@ /Library/LaunchDaemons/org.macports.ClamavScanSchedule.plist@ /Library/LaunchDaemons/org.macports.clamd.plist@ |
片端から、launchctlで登録しておく。(org.macports.ClamSMTP.plistはいらないな)
次はスケジュールだが、どこに書かれているのだろう。


