Skip to content

Instantly share code, notes, and snippets.

@zahna
Created November 30, 2016 18:12
Show Gist options
  • Save zahna/5bca8e79ba20a0449fc4f3cfa832e399 to your computer and use it in GitHub Desktop.
Save zahna/5bca8e79ba20a0449fc4f3cfa832e399 to your computer and use it in GitHub Desktop.
#!/bin/bash
XVFB=/usr/bin/Xvfb
XVFBARGS=":0 -screen 0 1280x1024x8 -fbdir /var/run"
PIDFILE=/var/run/xvfb.pid
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
daemon --pidfile $PIDFILE $XVFB $XVFBARGS
echo "."
;;
stop)
echo -n "Stopping virtual X frame buffer: Xvfb"
killproc -p $PIDFILE
echo "."
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment