【发布时间】:2018-02-28 00:24:40
【问题描述】:
first.sh 和 second.sh 两个脚本将用于在 Ubuntu 16.04 上使用 Xvfb 无头运行 test.sh 和 test2.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