My case: Compiling via portmaster (PM further) more 500 ports of KDE4. Background `pkg check` tasks begun suddenly and led to PM failure during next port installation. My suggestion: Make PM checking whether another process of pkg is running and locking database, and give user choice to kill all pkg processes or to wait till they exit themselves, and not quit such huge compil. like KDE4 or GNOME3 meta-ports. ports tree , kernel & world latest. Thank you for development.
(In reply to mikhail.rokhin from comment #0) > Background `pkg check` tasks begun suddenly pkg check -qsa is run by /usr/local/etc/periodic/security/460.pkg-checksum if security_status_pkgchecksum_enable=NO is not written to /etc/periodic.conf.
See also: bug # 232350.