我在远程linux上面临Xvfb的问题。当我运行命令
Xvfb :99 &
我在命令行上收到此消息
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX
我必须使用ctrl + c暂停它仍然会在后台运行,我正在编写一个shell脚本来自动执行它但是这个命令Xvfb :99 &
没有在后台运行!对此有何帮助?
我的shell脚本:
system("sudo yum -y install Xvfb");
system("sudo yum -y install firefox");
system("sudo yum -y install ImageMagick");
system("Xvfb :99 &");
system("export DISPLAY=:99");
答案 0 :(得分:5)
代替&尝试使用以下内容:
输入Xvfb后发出ctrl + z命令:99
然后输入bg将进程发送到后台运行,后续将继续在后台运行。
编辑:下面也应该有所帮助:
nohup Xvfb :99 > /dev/null 2>&1 &
或只是nohup Xvfb :99 &