首页 > 怎样在程序中操作 screen

怎样在程序中操作 screen

screen 是一个非常有用的软件,可以让程序在后台稳定的执行,而且管理上也非常方便,所以有很多东西我都是用 screen 管理的。

现在我想要写个管理后台,需要在程序中将 screen 中执行的服务重启,不知道怎么用 Python 或 Java 实现。

改用 nohup 应该是可以的,但是感觉 nohup 管理不方便。
或者还有什么能让各种语言的程序当后台服务一样运行的方法。


窗口1中while [[ 1 ]]; do 你的服务(阻塞); done

想重启时从其他窗口kill


When a program terminates, screen (per default) kills the window that contained it. If this window was in the foreground, the display switches to the previously displayed window; if none are left, screen exits.

所以说,你直接killscreen里面运行的程序,然后新开一个窗口,不就可以了吗?

【热门文章】
【热门文章】