4

我编写了一个launchd .plist,它应该在WindowServer 启动时附加一个调试器。脚本的主要部分看起来像

screen -D -m -S "WindowServer Debugger" \
gdb \
-x $GDBSCRIPT \
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/WindowServer \
$WSPID

这将启动一个分离的屏幕会话,其中 gdb 连接到 WindowServer。

但是,这似乎在 Snow Leopard 下的 launchd 中触发了一个错误条件,导致它向日志中输出错误消息:

com.apple.launchd[1] (0x10011c070.anonymous.screen[961]) Bug: launchd_core_logic.c:8250 (23932):0
com.apple.launchd[1] (0x10011c070.anonymous.screen[961]) Switching sessions is not allowed in the system Mach bootstrap.
com.apple.launchd[1] (0x10011c070.anonymous.screen[961]) _vprocmgr_switch_to_session(): kr = 0x44c

我应该注意,无论系统启动以来已经过了多长时间,都会出现“......系统Mach引导程序中不允许”消息。

是否有解决方法,以便我可以生成我的屏幕会话?

根据launchd的手册页,

守护进程不应尝试显示 UI 或直接与用户的登录会话交互。

这可能表明 launchd 将此行为视为与另一个会话交互并拒绝它。代码在这里,但我不熟悉: http: //launchd.macosforge.org/trac/browser/trunk/launchd/src/launchd_core_logic.c#L8250

4

2 回答 2

1

显然你不能在系统引导程序中分离(使用-D)。您可以在启动代理中(或在您的用户引导程序中)执行此操作。

于 2010-02-21T19:55:28.900 回答
1

我在使用屏幕版本 4.0.3 时遇到了这个问题。我在 git://git.sv.gnu.org/screen.git 上构建了可用的最新版本(4.1.dev),这为我解决了问题。

于 2010-10-14T08:50:03.327 回答