Skip to content

Instantly share code, notes, and snippets.

@axilleas
Forked from nyxcalamity/xvfb
Last active April 25, 2016 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axilleas/3fc13e0c90ad9f58bee903a41e8a6d48 to your computer and use it in GitHub Desktop.
Save axilleas/3fc13e0c90ad9f58bee903a41e8a6d48 to your computer and use it in GitHub Desktop.
/etc/init.d/xvfb service script
#! /bin/sh
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
### END INIT INFO
XVFB=/usr/bin/Xvfb
XVFB_ARGS=":1 -ac -screen 1 1600x1200x24"
XVFB_LOG=/var/log/xvfb
case "$1" in
start)
echo -n "Starting Xvfb: "
$XVFB $XVFB_ARGS 1>&2 2> $XVFB_LOG &
echo "OK"
;;
stop)
echo -n "Stopping Xvfb: "
killall Xvfb
echo "OK"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
exit 1
;;
esac
exit 0
@axilleas
Copy link
Author

On ubuntu 14.04 you'll have to first:

apt-get install xvfb psmisc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment