Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 从启动守护进程生成屏幕会话_Macos_Gnu Screen_Launchd - Fatal编程技术网

Macos 从启动守护进程生成屏幕会话

Macos 从启动守护进程生成屏幕会话,macos,gnu-screen,launchd,Macos,Gnu Screen,Launchd,我已经编写了一个launchd.plist,它应该在Windows服务器启动时将调试器附加到它。脚本的主要部分如下所示 screen -D -m -S "WindowServer Debugger" \ gdb \ -x $GDBSCRIPT \ /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/Win

我已经编写了一个launchd.plist,它应该在Windows服务器启动时将调试器附加到它。脚本的主要部分如下所示

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连接到WindowsServer

但是,这似乎会在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
我应该注意到,“…系统马赫引导中不允许”消息会出现,无论系统引导多长时间

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

根据launchd的手册页

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


这可能表明launchd将此行为视为与另一个会话交互并拒绝它。代码在这里,但我不熟悉它:

显然,您不能在系统引导中分离(使用-D)。您可以在launchagent中(或在用户引导程序中)执行此操作。

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

是的,但如果我不分离(使用-D或-D),屏幕就会抱怨我没有tty。由于Windows服务器是以不同的用户身份运行的,我不认为我可以为它制作一个LaunchAgent。是的,我无法在任何配置(在plist文件中指定用户名和/或用户组)中使用LaunchAgent或LaunchDaemon。最终,我只是使用Automator为单个用户创建了一个登录项,将shell脚本转换为应用程序。当然,这不是一个理想的解决方案,但苹果似乎在这方面阻碍了我们。这并没有解决山狮的问题。经过一些研究,问题似乎与屏幕无关,而是启动时不允许在启动期间进行交互式会话。“屏幕”似乎被launchd视为“交互式”。