Skip to content

Instantly share code, notes, and snippets.

@jollychang
Created June 27, 2011 10:24
Show Gist options
  • Save jollychang/1048635 to your computer and use it in GitHub Desktop.
Save jollychang/1048635 to your computer and use it in GitHub Desktop.
selenium and xvfb services @ gentoo
$ head -1000 /etc/conf.d/xvfb* /etc/init.d/{xvfb,selenium-daemon}
==> /etc/conf.d/xvfb <==
XVFB=/usr/bin/Xvfb
XVFBARGS=":90 -auth /etc/conf.d/xvfb.cfg -nolisten tcp"
PIDFILE=/var/run/xvfb.pid
==> /etc/conf.d/xvfb.cfg <==
localhost
==> /etc/init.d/xvfb <==
#!/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 ${?}
}
==> /etc/init.d/selenium-daemon <==
#!/sbin/runscript
PIDFILE=/var/run/selenium-daemon.pid
DISPLAY=:90
#change the JRE path
#JAVA=/usr/lib/jvm/icedtea6-bin/bin/java
JAVA=/usr/lib/jvm/sun-jdk-1.6/bin/java
JAR=/usr/lib64/python2.6/site-packages/SeleniumLibrary/lib/selenium-server.jar
PORT=5555
PROFILE=/usr/lib64/python2.6/site-packages/SeleniumLibrary/firefoxprofile
LOG=/var/log/selenium.log
depend() {
need net xvfb
use logger
}
start() {
ebegin "Starting selenium-daemon"
start-stop-daemon --start --quiet --background \
--make-pidfile --pidfile ${PIDFILE} \
--exec ${JAVA} -- -jar ${JAR} -port ${PORT} \
-firefoxProfileTemplate ${PROFILE} -log ${LOG}
eend $?
}
stop() {
ebegin "Stopping selenium-daemon"
start-stop-daemon --stop --quiet \
--pidfile ${PIDFILE}
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment