生产模式，多进程启动，如何为worker进程添加虚拟显示设备
项目用到headless-gl，需要增加一个显示设备给headless-gl做输出绑定，开发模式的时候xvfb-run -s "-ac -screen 0 1280x1024x24" npm run dev 这样运行可以正常运行。

生产模式要如何运行？

=================我看到有大佬说可以这样运行 ===============
实测在多进程方式启动时，如基于egg框架启动，上面的命令并不能给worker进程添加虚拟显示设备。
下面的命令可用于处理该情况：

export DISPLAY=:1 #增加虚拟显示设备环境变量
Xvfb :1 -ac & # 启动Xvfb服务
npm run start
one line:
(export DISPLAY=:1) && (Xvfb :1 -ac &) && npm run start
需要注意，webgl运行时也依赖DISPLAY环境变量，注意export的作用域问题


==========================================


==============但是实际运行的时候还是报错，求大佬们帮忙分析下问题，要如何解决============
我之前运行过命令，提示我要删除X-1-lock，我删除后重新运行，依然报服务已经运行，我项目跑起来后，调用执行，依然报错：
=============项目运行命令，以及报错后，停止项目=================
(base) [root@iZ8vbek68af6xbyqmspit7Z zhipianxing-node]# rm -rf /tmp/.X
.X11-unix/ .X1-lock .X2-lock .XIM-unix/
(base) [root@iZ8vbek68af6xbyqmspit7Z zhipianxing-node]# rm -rf /tmp/.X1-lock
(base) [root@iZ8vbek68af6xbyqmspit7Z zhipianxing-node]# rm -rf /tmp/.X2-lock
(base) [root@iZ8vbek68af6xbyqmspit7Z zhipianxing-node]# (export DISPLAY=:2) && (Xvfb :2 -ac &) && yarn run start
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
yarn run v1.22.15
$ egg-scripts start --daemon --port=7001 --env=prod --title=egg-server-zhipianxing
[egg-scripts] Starting egg application at /www/wwwroot/zhipianxing/zhipianxing-node
[egg-scripts] Run node --no-deprecation /www/wwwroot/zhipianxing/zhipianxing-node/node_modules/egg-scripts/lib/start-cluster {"port":7001,"title":"egg-server-zhipianxing","baseDir":"/www/wwwroot/zhipianxing/zhipianxing-node","framework":"/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/egg"} --title=egg-server-zhipianxing
[egg-scripts] Save log file to /root/logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] Wait Start: 3...
[egg-scripts] egg started on http://127.0.0.1:7001
Done in 4.21s.
(base) [root@iZ8vbek68af6xbyqmspit7Z zhipianxing-node]# yarn run stopyarn run v1.22.15
$ egg-scripts stop --title=egg-server-zhipianxing
[egg-scripts] stopping egg application with --title=egg-server-zhipianxing
[egg-scripts] got master pid ["7120"]
[egg-scripts] stopped
Done in 5.26s.
================报错信息======================
2021-11-28 18:43:02,884 ERROR 7139 nodejs.TypeError: Cannot read property 'ARRAY_BUFFER' of null
at FFTransition.createBuffer (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:73:45)
at FFTransition.createTransition (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:61:10)
at FFTransition.bindGL (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:40:10)
at /www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:119:57
at arrayEach (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/lodash/_arrayEach.js:15:9)
at forEach (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/lodash/forEach.js:38:10)
at Renderer.transBindGL (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:119:5)
at Renderer.start (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:55:10)

pid: 7139
hostname: iZ8vbek68af6xbyqmspit7Z

======================



补充一下问题：去掉--daemon 可以正常执行，我如何才能后台运行？

============这样可以运行=======
xvfb-run -s "-ac -screen 0 1280x1024x24" yarn start
yarn run v1.22.15
$ egg-scripts start --port=7001 --env=prod --title=egg-server-zhipianxing

===========加上--daemon 就会报错 ========
xvfb-run -s "-ac -screen 0 1280x1024x24" yarn start
yarn run v1.22.15
$ egg-scripts start --port=7001 --daemon --env=prod --title=egg-server-zhipianxing



## 相关环境信息
- **操作系统**：
- centos7
- **Node 版本**：
- v14.17.4
- **Egg 版本**：
- ^6.2.5
