我该如何停止此消息?

我该如何停止此消息?

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

我怎样才能停止此错误信息?

2012 年 3 月 3 日下午 3:35:03.002 com.apple.launchd.peruser.503:(com.hp.help.tocgenerator)限制重生:将在 10 秒内启动

答案1

它看起来像是由 HP 软件的某个组件为您的打印机/扫描仪/多功能设备生成的。(所有launchd作业都通过标签标识,该标签通常是开发人员的反向 DNS 格式的字符串(请参阅CFBundleIdentifier了解更多信息)。 在本例中为 hp.com。

[更新]:好的,在谷歌搜索该包标识符后,我偶然发现了这个PhotoSmart C4280 在 system.log 中重复出现错误消息HP 论坛中的主题。

从根本上来说,出现该问题的原因是编写 HP 软件的人并没有真正理解如何launchd正确实现 LaunchAgent。

我编写了一个 AppleScript 脚本来帮助自动完成卸载旧启动作业、更新 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

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

相关内容