dscl 无法在重新连接的屏幕内部工作
我使用的是 Mac OS X 10.5.8。我不确定这种情况何时开始发生,但我发现当我重新附加到从 ssh 会话启动的屏幕会话时,任何依赖 dscl(目录服务)或底层 getent 的东西都会失败。
如果我在终端中的该机器上启动会话,一切都会正常。只有远程启动的屏幕会话在重新连接时才会出现问题。
$ dscl . -list /Users
>> works
$ screen
$ dscl . -list /Users
>> works
[detached]
$ dscl . -list /Users
>> works
$ screen -x
$ dscl . -list /Users
Operation failed with error: eServerNotRunning
同样失败的是:
$ whoami
504
我已经重新启动、调试并用谷歌搜索了大约 6 个小时,但没有成功。
这真的很痛苦,因为它影响了很多应用程序(ssh、git、rake 等)。
我很好奇这是否会影响其他人,或者是否有人知道如何解决它。
I am on Mac OS X 10.5.8. I am not sure exactly when this started happening, but I find that when I re-attach to a screen session that was started from an ssh session, anything relying on dscl (directory services), or the underlying getent stuff, fails.
If I start the session on that machine in Terminal, everything works. Only remotely started screen sessions have problems when re-attached.
$ dscl . -list /Users
>> works
$ screen
$ dscl . -list /Users
>> works
[detached]
$ dscl . -list /Users
>> works
$ screen -x
$ dscl . -list /Users
Operation failed with error: eServerNotRunning
Also failing:
$ whoami
504
I have rebooted, debugged, and googled for about 6 hours now with no luck.
It is really painful since it affects lots of applications (ssh, git, rake, etc).
I am curious if this is affecting anyone else, or if anyone has any idea how to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是同一台计算机 (OS 10.5.8) 上两个帐户的示例。抱歉,无法在 ssh 上进行测试。考虑:
假设被记录到“一”:
现在记录到“二”时:
脚本启动,输出文件是 /dev/null
就是这样;)
如果好奇:Stackoverflow:为什么将“脚本”重定向到 /dev/null/ 允许“屏幕”在以其他用户身份 su 时工作?
Here's a sample within two accounts on the same machine (OS 10.5.8). Could not test it while on ssh, sorry. Consider:
Assume being logged to "one":
Now while logged to "two":
Script started, output file is /dev/null
That's it ;)
If curious: Stackoverflow: Why does redirecting 'script' to /dev/null/ allow 'screen' to work while su'ed as another user?