running Xvfb in background on remote linux

2019-07-09 03:15发布

i am facing issues with Xvfb on remote linux. when i run the command

Xvfb :99 &

I get this messages on the command line 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

and i have to suspend it using ctrl+c still it will be running in the background, i am writing a shell script to automate it but this command Xvfb :99 & is not running in the background ! any help regarding this ?

my shell script :

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");

标签: linux shell xvfb
1条回答
祖国的老花朵
2楼-- · 2019-07-09 04:06

instead of & try to use below:
issue ctrl+z command after entering Xvfb :99
then enter bg to send the process to run in background and following would keep on running in background.
EDIT: Below should also help:

nohup Xvfb :99 > /dev/null 2>&1 &

or simply nohup Xvfb :99 &

查看更多
登录 后发表回答