如何 "hack" GNU screen 可以在没有 tty 的情况下执行?

How to "hack" GNU screen to be able of being executed without a tty?

我需要能够 运行 GNU screen 使用 php 因为我的面板使用 PHP。如果没有办法,是否有其他方法可以让我向屏幕发送命令?

屏幕点赞:screen -S 9274 -p 0 -X stuff '(command here)'5?

谢谢。

您可以使用专为此类操作设计的nohup命令:

nohup - run a command immune to hangups, with output to a non-tty

您还可以使用 -d -m 参数以 分离模式 启动 screen

-d -m Start screen in "detached" mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts.