nohup SBCL ubuntu 无法从标准输入读取
在 Ubuntu 上,我使用线程编译了 sbcl 1.0.35。我可以愉快地从命令行使用 sbcl,我的 hunchentoot 网站可以使用线程,但当我注销时它就消失了。当我尝试 nohup sbcl
nohup ./src/runtime/sbcl --core output/sbcl.core
时,我得到
(SB-IMPL::SIMPLE-STREAM-PERROR "couldn't read from ~S" # 9)
我已经尝试了将标准输入重定向到 /dev/null 或文件并使用脚本命令行选项的各种组合,但我不太明白发生了什么。
如何使用 nohup 从 Linux 上的命令行启动 sbcl 并保持我的 repl(网站)运行?
On Ubuntu I compiled sbcl 1.0.35 with threading. I can happily use sbcl from the command line and my hunchentoot website works with threading but when I logout it's gone. When I attempt to nohup sbcl
nohup ./src/runtime/sbcl --core output/sbcl.core
I get
(SB-IMPL::SIMPLE-STREAM-PERROR "couldn't read from ~S" # 9)
I've attempted various combinations of redirecting the standard input to /dev/null or a file and using the script command line option but I don't quite get what is going on.
How do I start sbcl from the command line on linux with nohup and keep my repl(website) running?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Andrey Moskvitin 的 RESTAS Web 框架(“REST 应用程序服务器”)包含正确守护 SBCL 实例的代码。请参阅 http://github.com/archimag/restas/blob /master/contrib/restas-daemon.lisp。您可以轻松撕下 RESTAS 专用部件。
RESTAS web-framework ("REST Application Server") by Andrey Moskvitin contains code to properly daemonize SBCL instance. See http://github.com/archimag/restas/blob/master/contrib/restas-daemon.lisp. You can easily rip off RESTAS-specific parts.
您可以在 Gnu Screen 中启动 SBCL,然后从会话中分离。
这也使您可以稍后重新连接到 REPL。
You could start SBCL in Gnu Screen and then detach from the session.
This also gives you the possibility to reattach to your REPL later.
Dmity-vk 让我走上了正轨,谢谢。当您启动它时,SBCL 会尝试启动一个 repl,并从标准输入中读取。当您使用
nohup
时,标准输入将被重定向并且无法读取。然后 SBCL 落入调试器,该调试器尝试从标准中读取...因此出现无限循环。--script
标签几乎可以解决这个问题,只不过在读取脚本后它有一个(quit)
。所以我在脚本中加入了无限循环,瞧。所以在带有 sbcl 的 ubuntu 服务器上,这应该让你启动一个 hunchentoot 服务器
,其中 foo.lisp 的最后几行是这样的
Dmity-vk sent me on the right track, thank you. SBCL tries to start a repl when you start it up, and reads from the standard in. When you use
nohup
the standard in is redirected and cannot be read. SBCL then drops to the debugger which tries to read from standard in ... hence the endless loop. The--script
tag comes close to solving this except that it has a(quit)
once the script has been read. So I put an endless loop in my script and voila.so on an ubuntu server with sbcl this should let you start a hunchentoot server
where foo.lisp has as its last lines something like