Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running Xvfb in background on remote linux

Tags:

linux

shell

xvfb

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");
like image 348
Abhishek Tripathi Avatar asked Jan 06 '23 00:01

Abhishek Tripathi


1 Answers

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 &

like image 53
Mrunal Gosar Avatar answered Jan 12 '23 16:01

Mrunal Gosar