如何停止此消息?

Lar*_*ars 3 mac launchd osx-snow-leopard macos

我在运行 OS X 10.6.x 的 Mac 上,我看到以下launchd错误消息不断重复Console.app

如何停止此错误消息?

3/3/12 3:35:03.002 PM com.apple.launchd.peruser.503: (com.hp.help.tocgenerator) 节流重生:将在 10 秒后开始

NSG*_*God 5

看起来它是由 HP 软件的某些组件为您的打印机/扫描仪/多功能设备生成的。(所有launchd作业都由一个标签标识,该标签通常是开发人员的反向 DNS 格式字符串(有关详细信息,请参阅CFBundleIdentifier)。在这种情况下,它是 hp.com。

[更新]:好的,在谷歌搜索那个包标识符后,我在惠普论坛的system.log线程中发现了这个PhotoSmart C4280 重复错误消息

基本上,问题的原因是编写 HP 软件的人并不真正了解如何launchd正确实施LaunchAgent。

我编写了一个 AppleScript 脚本来帮助自动化卸载旧的 launchd 作业、更新 plist 文件和加载新作业的过程:

HP com.hp.help.tocgenerator Helper.app(.zip 文件,~29 KB)

如果您有兴趣,这是代码:

if existsFile(":Library:LaunchAgents:com.hp.help.tocgenerator.plist") then
    set plistFileContentsString to (do shell script "/bin/cat /Library/LaunchAgents/com.hp.help.tocgenerator.plist")
    if (plistFileContentsString contains "LaunchOnlyOnce") then
        display alert "It looks like your \"com.hp.help.tocgenerator.plist\"
              has already been helped." buttons "Quit" default button "Quit"
        quit
    else
        set ourPlistPath to POSIX path of (path to resource "com.hp.help.tocgenerator.plist")
        do shell script "/bin/launchctl unload /Library/LaunchAgents/com.hp.help.tocgenerator.plist;
 /bin/rm -f /Library/LaunchAgents/com.hp.help.tocgenerator.plist;
 /usr/bin/ditto --noqtn " & 
 quoted form of ourPlistPath &
   " /Library/LaunchAgents/com.hp.help.tocgenerator.plist;
 /usr/sbin/chown 0:0 /Library/LaunchAgents/com.hp.help.tocgenerator.plist;
 /bin/launchctl load /Library/LaunchAgents/com.hp.help.tocgenerator.plist"
 with administrator privileges
    end if
else
    display alert "Sorry, you don't appear to have the applicable
      HP software installed." buttons "Quit" default button "Quit"
    quit
end if
Run Code Online (Sandbox Code Playgroud)

您应该能够运行该 AppleScript 来缓解该问题。