【问题标题】:Xvfb failed to start when running second screen运行第二个屏幕时 Xvfb 无法启动
【发布时间】:2018-02-28 00:24:40
【问题描述】:

first.shsecond.sh 两个脚本将用于在 Ubuntu 16.04 上使用 Xvfb 无头运行 test.shtest2.sh

问题:运行first.sh后,运行second.sh时出现错误。

xvfb-run: 错误:Xvfb 启动失败

出了什么问题,我们该如何解决?谢谢!

first.sh

#/bin/sh

# Clean Process Space:
kill -9 `pidof xvfb-run`
kill -9 `pidof java`
kill -9 `pidof Xvfb`

# Launch a virtual screen
Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:1

# Launch the script
xvfb-run "/home/me/test.sh" &

history -c

second.sh

#/bin/sh

# Launch a virtual screen
Xvfb :2 -screen 0 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:2

# Launch the script
xvfb-run "/home/me/test2.sh" &

history -c

【问题讨论】:

    标签: linux bash ubuntu xvfb xserver


    【解决方案1】:

    在命令行中包含选项 -a,例如:

    xvfb-run -a "/home/me/test2.sh"
    

    该选项缺少--auto-servernum,它会在打开之前尝试查找空闲的服务器编号。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-21
      • 2015-05-10
      • 2021-07-02
      • 2011-11-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多