zoukankan      html  css  js  c++  java
  • redhat安装Xvfb

    1.下载xvfb的rpm包进行安装

        下载rpm安装包:http://rhn.redhat.com/errata/RHBA-2013-0083.html

        安装rpm包:#rpm -ivh --nodeps --force xxx.rpm

        启动:#Xvfb -ac :7 -screen 0 1280x1024x8

         #export DISPLAY=:7

        测试:#firefox http://www.investopedia.com

    2.创建快捷启动

       创建快捷启动服务:

       #cd /etc/init.d

       #touch xvfbd

       #vim xvfbd

    #!/bin/bash
    #
    # /etc/rc.d/init.d/xvfbd
    #
    # chkconfig: 345 95 28
    # description: Starts/Stops X Virtual Framebuffer server
    # processname: Xvfb
    #
     
    . /etc/init.d/functions
     
    [ "${NETWORKING}" = "no" ] && exit 0
     
    PROG="Xvfb"
    PROG_OPTIONS=":7 -ac -screen 0 1024x768x24"
    PROG_OUTPUT="/tmp/Xvfb.out"
     
    case "$1" inr
        start)
            echo -n "Starting : X Virtual Frame Buffer "
            $PROG $PROG_OPTIONS>>$PROG_OUTPUT 2>&1 &
            disown -ar
            /bin/usleep 500000
            status Xvfb & >/dev/null && echo_success || echo_failure
            RETVAL=$?
            if [ $RETVAL -eq 0 ]; then
                /bin/touch /var/lock/subsys/Xvfb
                /sbin/pidof -o  %PPID -x Xvfb > /var/run/Xvfb.pid
            fi
            echo
            ;;
        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

      启动服务:

      #chmod +x /etc/init.d/xvfbd

      #chkconfig xvfbd on

      #service xvfbd start

    3.使用xvfb进行测试:

       使用xvfb进行测试,需要设置:

       #xport DISPLAY=:7

       测试:#firefox http://www.investopedia.com

  • 相关阅读:
    Eclipse
    Android View Attributes
    Android Virtual Device
    Bootstrap
    Nginx常用命令
    [多线程]多线程(Thread、Runnable、Callable)
    Redis、MongoDB及Memcached的区别
    Linux将某目录授权给某组里的某用户
    CentOS修改locale解决调用API乱码问题
    MyBatis与Hibernate的区别?
  • 原文地址:https://www.cnblogs.com/lincj/p/5468505.html
Copyright © 2011-2022 走看看