Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d6aaaabad9
Fetching contributors…

Cannot retrieve contributors at this time

68 lines (59 sloc) 1.829 kB
#!/bin/sh
### BEGIN INIT INFO
# Provides: xvfb
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Xvfb daemon
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
NAME=xvfb
DAEMON=/usr/bin/Xvfb
PIDFILE=/var/run/Xvfb.pid
test -x $DAEMON || exit 5
if [ -r /etc/default/$NAME ]; then
. /etc/default/$NAME
fi
case $1 in
start)
log_daemon_msg "Starting Virtual Framebuffer" "Xvfb"
start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --startas $DAEMON -- $XVFB_OPTS
status=$?
log_end_msg $status
;;
stop)
log_daemon_msg "Stopping Virtual Framebuffer" "Xvfb"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
log_end_msg $?
rm -f $PIDFILE
;;
restart|force-reload)
$0 stop && sleep 2 && $0 start
;;
try-restart)
if $0 status >/dev/null; then
$0 restart
else
exit 0
fi
;;
reload)
exit 3
;;
status)
pidofproc -p $PIDFILE $DAEMON >/dev/null
status=$?
if [ $status -eq 0 ]; then
log_success_msg "Xvfb server is running."
else
log_failure_msg "Xvfb server is not running."
fi
exit $status
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 2
;;
esac
Jump to Line
Something went wrong with that request. Please try again.