Last modified: December 31 1969 16:00:00
Background:
Installation of ClamXav under the administrator account on OS X 10.4 (Intel MacBook) worked, and the admin user was able to configure the Folder Sentry feature to launch automatically at login. However, under a managed, non-admin-privileged "student" account, the auto-start-at-login preference refused to save, either because of privilege problems with the student account, a bug with ClamXav, or both.
The fix outlined here bypasses the default method that ClamXav uses (which involves adding the Sentry app to the user's System Preferences -> Accounts -> Login Items list). Instead, a launchd "agent" script is used to open the Sentry app (which is itself located inside the main ClamXav application, only visible via the Terminal or the "Show Package Contents" contextual menu item in the Finder.)
The startup script contains:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.clamav.sentry-startup</string> <key>ProgramArguments</key> <array> <string>open</string> <string>/Applications/ClamXav.app/Contents/Resources/ClamXavSentry.app</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>(right-click or control-click here and "Save Link as...")
Prerequisites:
As admin/root:
launchctl load -w /Library/LaunchAgents/com.clamav.sentry-startupThe sentry service should now launch (will appear in menu), and should launch upon login by any user. This setting should persist through reboots and shutdowns, but may need to be tweaked/rerun after Software Updates.