--- /dev/null
+#!/bin/sh
+#
+# Xvfb Xvfb headless X server
+#
+# chkconfig: 345 94 6
+#
+# description: Xvfb long service description
+#
+# processname: Xvfb
+# config: /etc/X11/xorg.conf
+# pidfile: /var/run/Xvfb.pid
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "Xvfb"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/Xvfb ] && . /etc/sysconfig/Xvfb
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/Xvfb ]; then
+ msg_already_running "Xvfb"
+ return
+ fi
+
+ checkconfig
+ msg_starting "Xvfb"
+ daemon /usr/bin/Xvfb --makepid
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/Xvfb
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/Xvfb ]; then
+ msg_not_running "Xvfb"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "Xvfb"
+ killproc Xvfb
+ killproc --pidfile /var/run/Xvfb.pid Xvfb -TERM
+ rm -f /var/lock/subsys/Xvfb
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/Xvfb ]; then
+ msg_not_running "Xvfb"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status Xvfb
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+# Set to "-ac" if you want to disable authentication. See Xvfb -help for more
+# options.
+# OPTIONS=""
+
+# Possible values: "inet", "inet6", "tcp", "unix", "". Use space as separator.
+# "tcp" is default, so it won't listen on any TCP socket unless you change
+# this value.
+# NOLISTEN="tcp"
+
+# It uses 20th display by default.
+# DISPLAY_NUMBER=":20"