Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@breiter
Last active June 6, 2020 19:08
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breiter/c19e3d9c7510b0c3860b to your computer and use it in GitHub Desktop.
Save breiter/c19e3d9c7510b0c3860b to your computer and use it in GitHub Desktop.
launchd plists for ClamAV daemon control on OS X
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/opt/local/var/log/clamav/*.log 644 3 1000 * J
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>_clamav</string>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.macports.clamd</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/sbin/clamd</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>_clamav</string>
<key>Label</key>
<string>org.macports.freshclam</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/freshclam</string>
</array>
<key>StartInterval</key>
<integer>21600</integer>
<key>UserName</key>
<string>_clamav</string>
</dict>
</plist>
@breiter
Copy link
Author

breiter commented Sep 5, 2014

  • clamav.conf goes in /etc/newsyslog.d/
  • plists go in /Library/LaunchDaemons/
  • clamd doesn't need to be running in order to use clamscan
  • the freshclam.plist schedules downloading virus definition updates
  • you have to configure clamd.conf and freshclam.conf in /opt/local/etc/ after port install clamav clamav-server

@wmertens
Copy link

wmertens commented Feb 2, 2016

How does the ondemand work? You don't specify a socket?

@wfiveash
Copy link

Thanks for the freshclam plist file, I was looking for that exact thing today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment