3 # Xvfb Xvfb headless X server
7 # description: Xvfb long service description
10 # config: /etc/X11/xorg.conf
11 # pidfile: /var/run/Xvfb.pid
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down "Xvfb"
33 # Get service config - may override defaults
34 [ -f /etc/sysconfig/Xvfb ] && . /etc/sysconfig/Xvfb
36 for I in "$NOLISTEN"; do
37 OPTIONS=$OPTIONS" -nolisten $I"
41 # Check if the service is already running?
42 if [ -f /var/lock/subsys/Xvfb ]; then
43 msg_already_running "Xvfb"
48 daemon --makepid --fork --pidfile /var/run/Xvfb.pid /usr/bin/Xvfb $OPTIONS $DISPLAY_NUMBER
50 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/Xvfb
54 if [ ! -f /var/lock/subsys/Xvfb ]; then
55 msg_not_running "Xvfb"
61 killproc --pidfile /var/run/Xvfb.pid Xvfb -TERM
62 rm -f /var/lock/subsys/Xvfb
66 if [ ! -f /var/lock/subsys/Xvfb ]; then
67 msg_not_running "Xvfb"
77 # See how we were called.
100 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"