-
-
Save ralphtheninja/a58165d6548c1b845cf21a215d82cd7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/xvfbd | |
# | |
# chkconfig: 345 95 28 | |
# description: Starts/Stops X Virtual Framebuffer server | |
# processname: Xvfb | |
# | |
[ "${NETWORKING}" = "no" ] && exit 0 | |
PROG="/usr/bin/Xvfb" | |
PROG_OPTIONS=":10 -ac" | |
PROG_OUTPUT="/tmp/Xvfb.out" | |
case "$1" in | |
start) | |
echo -n "Starting : X Virtual Frame Buffer " | |
$PROG $PROG_OPTIONS>>$PROG_OUTPUT 2>&1 & | |
disown -ar | |
;; | |
stop) | |
echo -n "Shutting down : X Virtual Frame Buffer" | |
killproc $PROG | |
RETVAL=$? | |
[ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/Xvfb | |
/var/run/Xvfb.pid | |
echo | |
;; | |
restart|reload) | |
$0 stop | |
$0 start | |
RETVAL=$? | |
;; | |
status) | |
status Xvfb | |
RETVAL=$? | |
;; | |
*) | |
echo $"Usage: $0 (start|stop|restart|reload|status)" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment