3 # Xvfb Xvfb headless X server
7 # description: Xvfb long service description
10 # config: /etc/X11/xorg.conf
11 # pidfile: /var/run/Xvfb.pid
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "Xvfb"
35 # Get service config - may override defaults
36 [ -f /etc/sysconfig/Xvfb ] && . /etc/sysconfig/Xvfb
38 for I in "$NOLISTEN"; do
39 OPTIONS=$OPTIONS" -nolisten $I"
43 # Check if the service is already running?
44 if [ -f /var/lock/subsys/Xvfb ]; then
45 msg_already_running "Xvfb"
51 # Beware the jabberwock!
52 daemon sh -c "\"exec sh -c 'echo \$\$ > /var/run/Xvfb.pid; exec /usr/bin/Xvfb $OPTIONS $DISPLAY_NUMBER' &\""
54 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/Xvfb
58 if [ ! -f /var/lock/subsys/Xvfb ]; then
59 msg_not_running "Xvfb"
66 rm -f /var/lock/subsys/Xvfb
70 if [ ! -f /var/lock/subsys/Xvfb ]; then
71 msg_not_running "Xvfb"
81 # See how we were called.
104 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"