Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Init-Script] Xvfb
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
andyknownasabu
Apprentice
Apprentice


Joined: 06 Feb 2003
Posts: 281
Location: Zurich, Switzerland

PostPosted: Tue Mar 28, 2006 10:35 pm    Post subject: [Init-Script] Xvfb Reply with quote

Hi all,

as I needed Xvfb for my work and wasn't able to find an init-script to automatically start it at boot time I wrote one myself...
And here we are, I hope it will help somebody someday ;-)

First, create an initscript called "xvfb" in /etc/init.d/ and put the following in:
Code:
#!/sbin/runscript
# Copyright 2006 Andreas Bulling
# Distributed under the terms of the GNU General Public License v2

start() {
        ebegin "Starting virtual X frame buffer: Xvfb"

        start-stop-daemon --start --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS

        eend ${?}
}

stop() {
        ebegin  "Stopping virtual X frame buffer: Xvfb"

        start-stop-daemon --stop --pidfile $PIDFILE

        eend ${?}
}

Then create another file also called "xvfb" but in /etc/conf.d/ and put the following in:
Code:
XVFB=/usr/X11R6/bin/Xvfb
XVFBARGS=":1 -auth /etc/conf.d/xvfb.cfg -nolisten tcp"
PIDFILE=/var/run/xvfb.pid

With this, Xvfb will be server number 1, won't listen for connections over tcp and will use the authorization config file xvfb.cfg.

The last step is to create this authorization file in /etc/conf.d/xvfb.cfg.
It only contains one line (in the simplest case):
Code:
localhost

That's it! Have fun using Xvfb (as in my case on a headless system with Apache Tomcat)! :-)
_________________
Please, also have a look at:
Global Marshall Plan Initiative
http://www.globalmarshallplan.org/
Back to top
View user's profile Send private message
njp963
n00b
n00b


Joined: 29 Jul 2004
Posts: 3
Location: London

PostPosted: Mon Dec 18, 2006 11:53 am    Post subject: Reply with quote

Thanks - just what I was looking for!
Back to top
View user's profile Send private message
pascalbrax
Apprentice
Apprentice


Joined: 21 Jan 2004
Posts: 280
Location: 127.0.0.1

PostPosted: Fri Apr 15, 2011 9:04 am    Post subject: Reply with quote

LOVE it! :D

i just had to type
Code:
export DISPLAY=":1"
and change the path to Xvfb in the /etc/conf.d/xvfb file, but it works! :)
_________________
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum