run DIMES on headless machine with xvfb

Dimes users are invited to bring comments, suggestions and all other happy thought about DIMES.

Moderators: BoazH, UDi, shavitt, idob

run DIMES on headless machine with xvfb

Postby cpqrst3 » Tue Nov 22, 2005 11:28 am

How can I prevent DIMES from going into background to run it in xvfb? If it goes into background xvfb exits immediatly because it thinks the process died.

Command:
xvfb-run -a -s "-screen 0 1024x768x24" /root/DIMES/run.sh

content of run.sh:
#!/bin/bash

cd /root/DIMES
export JAVA_HOME=/root/jdk1.5.0
make run

run.sh works fine when startet from xterm in a real xserver
Dual PPro180 does not count as Dual Core? :P
cpqrst3
 
Posts: 9
Joined: Mon Nov 21, 2005 10:06 pm

Postby cpqrst3 » Tue Nov 22, 2005 6:57 pm

Hi! I solved it myself, maybe this could be useful for others:
I wrote a script which checks for a running java instance, and loops while this is true, so it now runs fine with xvfb :D
Dual PPro180 does not count as Dual Core? :P
cpqrst3
 
Posts: 9
Joined: Mon Nov 21, 2005 10:06 pm

Postby raxhonp » Wed Nov 30, 2005 11:56 am

These are great news, finally an option to run it on all these spare Linux boxes.

Would you mind posting your script. BTW, the content of run.sh you posted is likely incomplete, or I don't understand what a "make run" can perform.

Also, what resources (memory, cpu usage, ...) doest it take to have xvfb and dimes running?

Thanks a lot

Philippe
raxhonp
 
Posts: 33
Joined: Tue May 17, 2005 4:07 pm
Location: Belgium

Postby cpqrst3 » Thu Dec 01, 2005 8:10 pm

so here it goes:
Code: Select all
filbert:~# cat DIMES/run.sh
#!/bin/bash

if [ -e "/tmp/DIMES" ]
then
    exit 0
fi

touch /tmp/DIMES

cd /root/DIMES
export JAVA_HOME=/root/jdk1.5.0
make run

sleep 30
while [ -n "`ps wax|grep java`" ]
do
    sleep 30
done
rm /tmp/DIMES

exit 0


"make run" calls "bash ./agent" (so you could also call agent.sh directly, don't know why I didn't :wink:), there is maybe an easier way than this script, but I never touched it again after it worked :roll: Of course you have to change paths of java and DIMES to your needs

as far as cpu-consumption, it's at < 0.2 system load on a 1,6GHz Duron, I didn't care for memory as this machine has enough unused of it (there are 512MB in it), One performance boost would be to switch automagically to messages tab somehow, because the graph creates the load (although it's just painted in memory), not dimes itself directly.
Dual PPro180 does not count as Dual Core? :P
cpqrst3
 
Posts: 9
Joined: Mon Nov 21, 2005 10:06 pm

Postby raxhonp » Tue Dec 13, 2005 1:54 pm

Thanks for the trick. It works great.

I found a way to switch to message tab or babysit DIMES using x11vnc:
1. run xvfb with the options '-l' (I'm not sure it's necessary though) and -f (to save the Xauthority in a specific location):
xvfb-run -a -l -f /root/DIMES/xvfb.Xauthority -s "-screen 0 1024x768x24" /root/DIMES/run.sh
2. run x11vnc knowing xvfb uses display 99 by default:
x11vnc -auth /root/DIMES/xvfb.Xauthority -display 99

You can now access your xvfb session using your prefered VNC client (TightVNC).
raxhonp
 
Posts: 33
Joined: Tue May 17, 2005 4:07 pm
Location: Belgium

Postby cpqrst3 » Wed Dec 14, 2005 2:45 pm

an automatic way for changing to message tab is more useful to me because that computer is booted per cronjob and shutdown by cronjob, but the idea with vnc is great :D
Dual PPro180 does not count as Dual Core? :P
cpqrst3
 
Posts: 9
Joined: Mon Nov 21, 2005 10:06 pm

Re: run DIMES on headless machine with xvfb

Postby cpqrst3 » Sat Sep 18, 2010 7:23 am

hi marryanne!

this is thread is 5 years old....
Dual PPro180 does not count as Dual Core? :P
cpqrst3
 
Posts: 9
Joined: Mon Nov 21, 2005 10:06 pm


Return to Dimes users forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron