checkPermissions Missing write access to /usr/local/lib

Linux配置RN环境报错及解决办法
博客讲述了在Linux系统配置RN环境时,执行‘npm install -g yarn react-native-cl’命令报错,解决办法是增加sudo,使用‘sudo npm install -g yarn react-native-cl’命令。
  • linux配置rn环境,执行命令:npm install -g yarn react-native-cl,提示报错。
  • 解决办法:增加sudo,即使用命令,sudo npm install -g yarn react-native-cl即可。
[gitlab-runner@c ~]$ npm install gitbook-cli -g npm WARN deprecated q@1.5.0: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. npm WARN deprecated npm WARN deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) [..................] - fetchMetadata: WARN deprecated q@1.5.0: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScri [..................] | fetchMetadata: WARN deprecated q@1.5.0: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScri [..................] \ fetchMetadata: WARN deprecated q@1.5.0: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScri npm WARN checkPermissions Missing write access to /usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/ansistyles npm WARN checkPermissions Missing write access to /usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/path-is-inside npm WARN checkPermissions Missing write access to /usr/local/node/lib/node_modules/gitbook-cli npm WARN checkPermissions Missing write access to /usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules npm WARN checkPermissions Missing write access to /usr/local/node/lib/node_modules npm ERR! code EACCES npm ERR! syscall access npm ERR! path /usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/ansistyles npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, access '/usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/ansistyles' npm ERR! [Error: EACCES: permission denied, access '/usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/ansistyles'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/node/lib/node_modules/gitbook-cli/node_modules/npmi/node_modules/npm/node_modules/ansistyles' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! /home/gitlab-runner/.npm/_logs/2025-08-14T09_56_46_078Z-debug.log
08-15
[root@yfw ~]# cd /opt/openfire/enterprise/spark/Spark [root@yfw Spark]# # 1. 创建提取目录 [root@yfw Spark]# cd /tmp [root@yfw tmp]# mkdir -p xvfb-extract && cd xvfb-extract [root@yfw xvfb-extract]# rm -rf * [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 2. 解压 RPM 内容到当前目录 [root@yfw xvfb-extract]# rpm2cpio ../xorg-x11-server-Xvfb-1.20.11-2.el8.x86_64.rpm | cpio -idmv ./usr/bin/Xvfb ./usr/bin/xvfb-run ./usr/lib/.build-id ./usr/lib/.build-id/90 ./usr/lib/.build-id/90/ef040f79a6dc2a63bd97c6f8615551a9918520 ./usr/share/man/man1/Xvfb.1.gz 4104 blocks [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 3. 查看是否成功提取出 Xvfb [root@yfw xvfb-extract]# ls -l usr/bin/Xvfb -rwxr-xr-x 1 root root 2091144 Jun 11 2021 usr/bin/Xvfb [root@yfw xvfb-extract]# # 输出应类似: [root@yfw xvfb-extract]# # -rwxr-xr-x 1 root root 298808 Jan 1 2021 usr/bin/Xvfb [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 4. 复制到 openfire 用户 bin 目录 [root@yfw xvfb-extract]# su - openfire -c 'mkdir -p ~/bin' This account is currently not available. [root@yfw xvfb-extract]# cp usr/bin/Xvfb /home/openfire/bin/ cp: cannot create regular file '/home/openfire/bin/': Not a directory [root@yfw xvfb-extract]# chown openfire:openfire /home/openfire/bin/Xvfb chown: cannot access '/home/openfire/bin/Xvfb': No such file or directory [root@yfw xvfb-extract]# chmod +x /home/openfire/bin/Xvfb chmod: cannot access '/home/openfire/bin/Xvfb': No such file or directory [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 5. 验证可执行性 [root@yfw xvfb-extract]# su - openfire -s /bin/bash -c 'which Xvfb; Xvfb -help | head -5' /usr/bin/which: no Xvfb in (/usr/local/ffmpeg/bin:/opt/spark/bin:=en_US.UTF-8:/usr/local/ffmpeg/bin) -bash: head: command not found -bash: Xvfb: command not found [root@yfw xvfb-extract]# grep openfire /etc/passwd openfire:x:990:985:Openfire Jabber Server:/opt/openfire:/sbin/nologin [root@yfw xvfb-extract]# # 删除之前错误创建的内容(可选) [root@yfw xvfb-extract]# rm -rf /home/openfire/bin [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 在真正的 home 目录下创建 bin [root@yfw xvfb-extract]# mkdir -p /opt/openfire/bin [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 复制 Xvfb 到正确位置 [root@yfw xvfb-extract]# cp /tmp/xvfb-extract/usr/bin/Xvfb /opt/openfire/bin/ [root@yfw xvfb-extract]# cp /tmp/xvfb-extract/usr/bin/xvfb-run /opt/openfire/bin/ # 可选 [root@yfw xvfb-extract]# chown -R openfire:openfire /opt/openfire/bin [root@yfw xvfb-extract]# chmod +x /opt/openfire/bin/Xvfb [root@yfw xvfb-extract]# [ -f /opt/openfire/bin/xvfb-run ] && chmod +x /opt/openfire/bin/xvfb-run [root@yfw xvfb-extract]# su -s /bin/bash openfire -c ' > export PATH=/opt/openfire/bin:$PATH > export DISPLAY=:99 > > # 检查是否能找到 Xvfb > which Xvfb > Xvfb -help | head -5 > ' ~/bin/Xvfb use: X [:<display>] [option] -a # default pointer acceleration (factor) -ac disable access control restrictions -audit int set audit trail level -auth file select authorization file -br create root window with black background +bs enable any backing store support -bs disable any backing store support -c turns off key-click c # key-click volume (0-100) -cc int default color visual class -nocursor disable the cursor -core generate core dump on fatal error -displayfd fd file descriptor to write display number to when ready to connect -dpi int screen resolution in dots per inch -dpms disables VESA DPMS monitor control -deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs -f # bell base (0-100) -fc string cursor font -fn string default font name -fp string default font path -help prints message with these options +iglx Allow creating indirect GLX contexts -iglx Prohibit creating indirect GLX contexts (default) -I ignore all remaining arguments -ld int limit data space to N Kb -lf int limit number of open files to N -ls int limit stack space to N Kb -nolock disable the locking mechanism -maxclients n set maximum number of clients (power of two) -nolisten string don't listen on protocol -listen string listen on protocol -noreset don't reset after last client exists -background [none] create root window with no background -reset reset after last client exists -p # screen-saver pattern duration (minutes) -pn accept failure to listen on all ports -nopn reject failure to listen on all ports -r turns off auto-repeat r turns on auto-repeat -render [default|mono|gray|color] set render color alloc policy -retro start with classic stipple and cursor -s # screen-saver timeout (minutes) -seat string seat to run on -t # default pointer threshold (pixels/t) -terminate terminate at server reset -to # connection time out -tst disable testing extensions ttyxx server started from init on /dev/ttyxx v video blanking for screen-saver -v screen-saver without video blanking -wm WhenMapped default backing-store -wr create root window with white background -maxbigreqsize set maximal bigrequest size +xinerama Enable XINERAMA extension -xinerama Disable XINERAMA extension -dumbSched Disable smart scheduling and threaded input, enable old behavior -schedInterval int Set scheduler interval in msec -sigstop Enable SIGSTOP based startup +extension name Enable extension -extension name Disable extension -query host-name contact named host for XDMCP -broadcast broadcast for XDMCP -multicast [addr [hops]] IPv6 multicast for XDMCP -indirect host-name contact named host for indirect XDMCP -port port-num UDP port number to send messages to -from local-address specify the local address to connect from -once Terminate server after one session -class display-class specify display class to send in manage -cookie xdm-auth-bits specify the magic cookie for XDMCP -displayID display-id manufacturer display ID for request [+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ] enable/disable accessx key sequences -ardelay set XKB autorepeat delay -arinterval set XKB autorepeat interval -screen scrn WxHxD set screen's width, height, depth -pixdepths list-of-int support given pixmap depths +/-render turn on/off RENDER extension support(default on) -linebias n adjust thin line pixelization -blackpixel n pixel value for black -whitepixel n pixel value for white -fbdir directory put framebuffers in mmap'ed files in directory -shmem put framebuffers in shared memory [root@yfw xvfb-extract]# su -s /bin/bash openfire -c ' > export PATH=/opt/openfire/bin:$PATH > export DISPLAY=:99 > > # 启动 Xvfb(如果尚未运行) > if ! pgrep -f "Xvfb :99" > /dev/null; then > echo "🚀 Starting Xvfb on DISPLAY=:99" > Xvfb :99 -screen 0 1024x768x24 -nolisten tcp & > sleep 3 > fi > > # 进入 Spark 目录并启动客户端 > cd /opt/openfire/enterprise/spark/Spark || { echo "❌ Error: Spark directory not found!"; exit 1; } > echo "🎮 Launching Spark client..." > exec ./Spark & > ' 🎮 Launching Spark client... [root@yfw xvfb-extract]# java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jivesoftware.launcher.Startup.start(Startup.java:75) at org.jivesoftware.launcher.Startup.main(Startup.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:69) at install4j.org.jivesoftware.launcher.Startup.main(Unknown Source) Caused by: java.awt.AWTError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65) at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.Toolkit$2.run(Toolkit.java:860) at java.awt.Toolkit$2.run(Toolkit.java:855) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854) at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2032) at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158) at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431) at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148) at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577) at javax.swing.UIManager.setLookAndFeel(UIManager.java:539) at javax.swing.UIManager.setLookAndFeel(UIManager.java:579) at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349) at javax.swing.UIManager.initialize(UIManager.java:1459) at javax.swing.UIManager.maybeInitialize(UIManager.java:1426) at javax.swing.UIManager.getInstalledLookAndFeels(UIManager.java:419) at javax.swing.UIManager.installLookAndFeel(UIManager.java:462) at javax.swing.UIManager.installLookAndFeel(UIManager.java:481) at org.jivesoftware.spark.ui.themes.LookAndFeelManager.<clinit>(LookAndFeelManager.java:40) at org.jivesoftware.Spark.startup(Spark.java:163) ... 13 more [root@yfw xvfb-extract]# # 查看 Xvfb 是否在运行 [root@yfw xvfb-extract]# pgrep -f Xvfb [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 查看 Spark Java 进程 [root@yfw xvfb-extract]# pgrep -f Spark | xargs ps -fp error: list of process IDs must follow -p Usage: ps [options] Try 'ps --help <simple|list|output|threads|misc|all>' or 'ps --help <s|l|o|t|m|a>' for additional help text. For more details see ps(1). [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 或查看是否有 Java 进程属于 openfire [root@yfw xvfb-extract]# ps aux | grep java | grep openfire openfire 1328 0.2 8.5 3934888 327252 ? Sl Oct16 41:50 /usr/lib/jvm/java-11/bin/java -server -Djdk.tls.ephemeralDHKeySize=matched -Djsse.SSLEngine.acceptLargeFragments=true -Dlog4j.configurationFile=/opt/openfire/bin/../lib/log4j2.xml -Dlog4j2.formatMsgNoLookups=true -Dlog4j.skipJansi=false -DopenfireHome=/opt/openfire/bin/../ -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/.install4j/i4jruntime.jar:/opt/openfire/.install4j/launchere44106de.jar:/opt/openfire/lib/* install4j.org.jivesoftware.openfire.starter.ServerStarter start openfire 4101 0.1 5.0 3746016 192120 ? Sl Oct16 28:12 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jvb/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jvb -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jitsi-videobridge-2.1-SNAPSHOT.jar:./jitsi-videobridge-2.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.videobridge.MainKt --apis=rest openfire 4124 0.0 2.8 3737208 107320 ? Sl Oct16 14:17 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jicofo/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jicofo -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jicofo-1.1-SNAPSHOT.jar:./jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.jicofo.Main --host=localhost --port=5275 --domain=localhost --secret=ElaQPVPKh05Zy4pb3Rgrvmm5XFoXVadRneWHyRqr --user_domain=localhost --user_name=focus --user_password=yra84zlHMIbfpL8CQpJDYDz5ODmtQXPpoRVds1WN [root@yfw xvfb-extract]# su -s /bin/bash openfire -c ' > export PATH=/opt/openfire/bin:$PATH > export DISPLAY=:99 > > # 检查是否已有 Xvfb 运行,避免重复启动 > if ! pgrep -f "Xvfb :99" > /dev/null; then > echo "🚀 Starting Xvfb on DISPLAY=:99" > Xvfb :99 -screen 0 1024x768x24 -nolisten tcp & > sleep 3 > fi > > # 检查 Xvfb 是否真的起来了 > if ! ps aux | grep Xvfb | grep -q :99; then > echo "❌ Failed to start Xvfb!" > exit 1 > fi > > # 进入 Spark 目录并启动客户端 > cd /opt/openfire/enterprise/spark/Spark || { echo "❌ Spark directory not found!"; exit 1; } > > echo "🎮 Launching Spark client..." > exec ./Spark & > ' 🎮 Launching Spark client... [root@yfw xvfb-extract]# java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jivesoftware.launcher.Startup.start(Startup.java:75) at org.jivesoftware.launcher.Startup.main(Startup.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:69) at install4j.org.jivesoftware.launcher.Startup.main(Unknown Source) Caused by: java.awt.AWTError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65) at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at java.awt.Toolkit$2.run(Toolkit.java:860) at java.awt.Toolkit$2.run(Toolkit.java:855) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854) at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2032) at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158) at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431) at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148) at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577) at javax.swing.UIManager.setLookAndFeel(UIManager.java:539) at javax.swing.UIManager.setLookAndFeel(UIManager.java:579) at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349) at javax.swing.UIManager.initialize(UIManager.java:1459) at javax.swing.UIManager.maybeInitialize(UIManager.java:1426) at javax.swing.UIManager.getInstalledLookAndFeels(UIManager.java:419) at javax.swing.UIManager.installLookAndFeel(UIManager.java:462) at javax.swing.UIManager.installLookAndFeel(UIManager.java:481) at org.jivesoftware.spark.ui.themes.LookAndFeelManager.<clinit>(LookAndFeelManager.java:40) at org.jivesoftware.Spark.startup(Spark.java:163) ... 13 more [root@yfw xvfb-extract]# # 查看是否有新的 Java 进程(属于 Spark) [root@yfw xvfb-extract]# ps aux | grep java | grep openfire openfire 1328 0.2 8.5 3934888 327272 ? Sl Oct16 41:51 /usr/lib/jvm/java-11/bin/java -server -Djdk.tls.ephemeralDHKeySize=matched -Djsse.SSLEngine.acceptLargeFragments=true -Dlog4j.configurationFile=/opt/openfire/bin/../lib/log4j2.xml -Dlog4j2.formatMsgNoLookups=true -Dlog4j.skipJansi=false -DopenfireHome=/opt/openfire/bin/../ -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/.install4j/i4jruntime.jar:/opt/openfire/.install4j/launchere44106de.jar:/opt/openfire/lib/* install4j.org.jivesoftware.openfire.starter.ServerStarter start openfire 4101 0.1 5.0 3746016 194592 ? Sl Oct16 28:13 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jvb/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jvb -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jitsi-videobridge-2.1-SNAPSHOT.jar:./jitsi-videobridge-2.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.videobridge.MainKt --apis=rest openfire 4124 0.0 2.8 3737208 107320 ? Sl Oct16 14:17 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jicofo/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jicofo -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jicofo-1.1-SNAPSHOT.jar:./jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.jicofo.Main --host=localhost --port=5275 --domain=localhost --secret=ElaQPVPKh05Zy4pb3Rgrvmm5XFoXVadRneWHyRqr --user_domain=localhost --user_name=focus --user_password=yra84zlHMIbfpL8CQpJDYDz5ODmtQXPpoRVds1WN [root@yfw xvfb-extract]# # 查看是否有 Xvfb 进程 [root@yfw xvfb-extract]# pgrep -f "Xvfb :99" [root@yfw xvfb-extract]# su -s /bin/bash openfire -c ' > export PATH=/opt/openfire/bin:$PATH > export DISPLAY=:99 > > echo "🔧 Testing Xvfb on :99..." > > # 先杀掉旧的(如果有) > pkill -f "Xvfb :99" > > # 启动 Xvfb,并前台运行以便看错误 > Xvfb :99 -screen 0 1024x768x24 -nolisten tcp > ' 🔧 Testing Xvfb on :99... pkill: killing pid 265229 failed: Operation not permitted Terminated [root@yfw xvfb-extract]# ps aux | grep Xvfb root 265542 0.0 0.0 9208 1100 pts/0 S+ 08:46 0:00 grep --color=auto Xvfb [root@yfw xvfb-extract]# su -s /bin/bash openfire << 'EOF' > export DISPLAY=:99 > export PATH=/opt/openfire/bin:$PATH > > # 清理可能的旧锁文件(虽然现在没有,但保险起见) > rm -f /tmp/.X99-lock /tmp/.X11-unix/X99 2>/dev/null > > # 启动 Xvfb 虚拟显示器 > echo "🚀 Starting Xvfb on :99..." > Xvfb :99 -screen 0 1024x768x24 -nolisten tcp -novtswitch -nocursor & > > # 等待几秒让服务初始化 > sleep 3 > > # 验证是否成功启动 > if pgrep -f "Xvfb :99" > /dev/null; then > echo "✅ Xvfb is running" > else > echo "❌ Failed to start Xvfb!" > exit 1 > fi > > # 测试 DISPLAY 是否可用(需要 xorg-x11-utils 包) > if command -v xdpyinfo >/dev/null; then > if xdpyinfo -display :99 >/dev/null 2>&1; then > echo "🟢 xdpyinfo OK: DISPLAY :99 is accessible" > else > echo "🔴 xdpyinfo FAILED: Cannot connect to DISPLAY :99" > echo "💡 Check Xvfb logs or missing fonts" > fi > else > echo "🟡 Tip: Install xorg-x11-utils for better debugging:" > echo " yum install -y xorg-x11-utils" > fi > > # 进入 Spark 目录并启动 > cd /opt/openfire/enterprise/spark/Spark || { echo "❌ Spark directory not found!"; exit 1; } > > echo "🎮 Launching Spark client..." > exec ./Spark & > EOF 🚀 Starting Xvfb on :99... Unrecognized option: -novtswitch use: X [:<display>] [option] -a # default pointer acceleration (factor) -ac disable access control restrictions -audit int set audit trail level -auth file select authorization file -br create root window with black background +bs enable any backing store support -bs disable any backing store support -c turns off key-click c # key-click volume (0-100) -cc int default color visual class -nocursor disable the cursor -core generate core dump on fatal error -displayfd fd file descriptor to write display number to when ready to connect -dpi int screen resolution in dots per inch -dpms disables VESA DPMS monitor control -deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs -f # bell base (0-100) -fc string cursor font -fn string default font name -fp string default font path -help prints message with these options +iglx Allow creating indirect GLX contexts -iglx Prohibit creating indirect GLX contexts (default) -I ignore all remaining arguments -ld int limit data space to N Kb -lf int limit number of open files to N -ls int limit stack space to N Kb -nolock disable the locking mechanism -maxclients n set maximum number of clients (power of two) -nolisten string don't listen on protocol -listen string listen on protocol -noreset don't reset after last client exists -background [none] create root window with no background -reset reset after last client exists -p # screen-saver pattern duration (minutes) -pn accept failure to listen on all ports -nopn reject failure to listen on all ports -r turns off auto-repeat r turns on auto-repeat -render [default|mono|gray|color] set render color alloc policy -retro start with classic stipple and cursor -s # screen-saver timeout (minutes) -seat string seat to run on -t # default pointer threshold (pixels/t) -terminate terminate at server reset -to # connection time out -tst disable testing extensions ttyxx server started from init on /dev/ttyxx v video blanking for screen-saver -v screen-saver without video blanking -wm WhenMapped default backing-store -wr create root window with white background -maxbigreqsize set maximal bigrequest size +xinerama Enable XINERAMA extension -xinerama Disable XINERAMA extension -dumbSched Disable smart scheduling and threaded input, enable old behavior -schedInterval int Set scheduler interval in msec -sigstop Enable SIGSTOP based startup +extension name Enable extension -extension name Disable extension -query host-name contact named host for XDMCP -broadcast broadcast for XDMCP -multicast [addr [hops]] IPv6 multicast for XDMCP -indirect host-name contact named host for indirect XDMCP -port port-num UDP port number to send messages to -from local-address specify the local address to connect from -once Terminate server after one session -class display-class specify display class to send in manage -cookie xdm-auth-bits specify the magic cookie for XDMCP -displayID display-id manufacturer display ID for request [+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ] enable/disable accessx key sequences -ardelay set XKB autorepeat delay -arinterval set XKB autorepeat interval -screen scrn WxHxD set screen's width, height, depth -pixdepths list-of-int support given pixmap depths +/-render turn on/off RENDER extension support(default on) -linebias n adjust thin line pixelization -blackpixel n pixel value for black -whitepixel n pixel value for white -fbdir directory put framebuffers in mmap'ed files in directory -shmem put framebuffers in shared memory (EE) Fatal server error: (EE) Unrecognized option: -novtswitch (EE) ❌ Failed to start Xvfb! [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# ps aux | grep java | grep openfire openfire 1328 0.2 8.5 3934888 325616 ? Sl Oct16 41:51 /usr/lib/jvm/java-11/bin/java -server -Djdk.tls.ephemeralDHKeySize=matched -Djsse.SSLEngine.acceptLargeFragments=true -Dlog4j.configurationFile=/opt/openfire/bin/../lib/log4j2.xml -Dlog4j2.formatMsgNoLookups=true -Dlog4j.skipJansi=false -DopenfireHome=/opt/openfire/bin/../ -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/.install4j/i4jruntime.jar:/opt/openfire/.install4j/launchere44106de.jar:/opt/openfire/lib/* install4j.org.jivesoftware.openfire.starter.ServerStarter start openfire 4101 0.1 5.0 3746016 193364 ? Sl Oct16 28:13 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jvb/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jvb -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jitsi-videobridge-2.1-SNAPSHOT.jar:./jitsi-videobridge-2.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.videobridge.MainKt --apis=rest openfire 4124 0.0 2.8 3737208 107344 ? Sl Oct16 14:17 /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-4.el8_5.x86_64/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Dconfig.file=/opt/openfire/bin/../plugins/pade/classes/jicofo/application.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/opt/openfire/bin/../plugins/pade/classes/jicofo -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=./logging.properties -Djdk.tls.ephemeralDHKeySize=2048 -cp ./jicofo-1.1-SNAPSHOT.jar:./jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar org.jitsi.jicofo.Main --host=localhost --port=5275 --domain=localhost --secret=ElaQPVPKh05Zy4pb3Rgrvmm5XFoXVadRneWHyRqr --user_domain=localhost --user_name=focus --user_password=yra84zlHMIbfpL8CQpJDYDz5ODmtQXPpoRVds1WN [root@yfw xvfb-extract]# su -s /bin/bash openfire -c '/opt/openfire/bin/Xvfb -help' use: X [:<display>] [option] -a # default pointer acceleration (factor) -ac disable access control restrictions -audit int set audit trail level -auth file select authorization file -br create root window with black background +bs enable any backing store support -bs disable any backing store support -c turns off key-click c # key-click volume (0-100) -cc int default color visual class -nocursor disable the cursor -core generate core dump on fatal error -displayfd fd file descriptor to write display number to when ready to connect -dpi int screen resolution in dots per inch -dpms disables VESA DPMS monitor control -deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs -f # bell base (0-100) -fc string cursor font -fn string default font name -fp string default font path -help prints message with these options +iglx Allow creating indirect GLX contexts -iglx Prohibit creating indirect GLX contexts (default) -I ignore all remaining arguments -ld int limit data space to N Kb -lf int limit number of open files to N -ls int limit stack space to N Kb -nolock disable the locking mechanism -maxclients n set maximum number of clients (power of two) -nolisten string don't listen on protocol -listen string listen on protocol -noreset don't reset after last client exists -background [none] create root window with no background -reset reset after last client exists -p # screen-saver pattern duration (minutes) -pn accept failure to listen on all ports -nopn reject failure to listen on all ports -r turns off auto-repeat r turns on auto-repeat -render [default|mono|gray|color] set render color alloc policy -retro start with classic stipple and cursor -s # screen-saver timeout (minutes) -seat string seat to run on -t # default pointer threshold (pixels/t) -terminate terminate at server reset -to # connection time out -tst disable testing extensions ttyxx server started from init on /dev/ttyxx v video blanking for screen-saver -v screen-saver without video blanking -wm WhenMapped default backing-store -wr create root window with white background -maxbigreqsize set maximal bigrequest size +xinerama Enable XINERAMA extension -xinerama Disable XINERAMA extension -dumbSched Disable smart scheduling and threaded input, enable old behavior -schedInterval int Set scheduler interval in msec -sigstop Enable SIGSTOP based startup +extension name Enable extension -extension name Disable extension -query host-name contact named host for XDMCP -broadcast broadcast for XDMCP -multicast [addr [hops]] IPv6 multicast for XDMCP -indirect host-name contact named host for indirect XDMCP -port port-num UDP port number to send messages to -from local-address specify the local address to connect from -once Terminate server after one session -class display-class specify display class to send in manage -cookie xdm-auth-bits specify the magic cookie for XDMCP -displayID display-id manufacturer display ID for request [+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ] enable/disable accessx key sequences -ardelay set XKB autorepeat delay -arinterval set XKB autorepeat interval -screen scrn WxHxD set screen's width, height, depth -pixdepths list-of-int support given pixmap depths +/-render turn on/off RENDER extension support(default on) -linebias n adjust thin line pixelization -blackpixel n pixel value for black -whitepixel n pixel value for white -fbdir directory put framebuffers in mmap'ed files in directory -shmem put framebuffers in shared memory [root@yfw xvfb-extract]# # 清理旧状态 [root@yfw xvfb-extract]# rm -f /tmp/.X99-lock /tmp/.X11-unix/X99 [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 切换到 openfire 用户并启动 Xvfb + Spark [root@yfw xvfb-extract]# su -s /bin/bash openfire << 'EOF' > > export DISPLAY=:99 > export PATH=/opt/openfire/bin:$PATH > > # 再次清理锁文件(在用户上下文中) > rm -f /tmp/.X99-lock /tmp/.X11-unix/X99 > > echo "🚀 Starting Xvfb on :99..." > Xvfb :99 -screen 0 1024x768x24 -nolisten tcp -nocursor & > > sleep 3 > > # 检查进程是否存在 > if pgrep -f "Xvfb.*:99" > /dev/null; then > echo "✅ Xvfb is running (PID: $(pgrep -f "Xvfb.*:99"))" > else > echo "❌ Failed to start Xvfb!" > exit 1 > fi > > # 测试 DISPLAY 可达性(需要 xdpyinfo) > if command -v xdpyinfo >/dev/null; then > if xdpyinfo -display :99 >/dev/null 2>&1; then > echo "🟢 xdpyinfo OK: DISPLAY :99 is accessible" > else > echo "🔴 xdpyinfo FAILED: Cannot connect to DISPLAY :99" > echo "💡 Check logs or missing fonts" > fi > else > echo "🟡 Tip: Install xorg-x11-utils for debugging:" > echo " yum install -y xorg-x11-utils" > fi > > # 启动 Spark 客户端 > cd /opt/openfire/enterprise/spark/Spark || { echo "❌ Spark directory not found!"; exit 1; } > > echo "🎮 Launching Spark client..." > exec ./Spark & > EOF 🚀 Starting Xvfb on :99... sh: /usr/bin/xkbcomp: No such file or directory sh: /usr/bin/xkbcomp: No such file or directory XKB: Failed to compile keymap Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config. (EE) Fatal server error: (EE) Failed to activate virtual core keyboard: 2(EE) ❌ Failed to start Xvfb! [root@yfw xvfb-extract]# # 安装工具包 [root@yfw xvfb-extract]# yum install -y xorg-x11-utils Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 1:12:27 ago on Thu Oct 30 07:39:51 2025. Dependencies resolved. ========================================================================================================== Package Architecture Version Repository Size ========================================================================================================== Installing: xorg-x11-utils x86_64 7.5-28.el8 AppStream 136 k Installing dependencies: libXxf86dga x86_64 1.1.5-1.el8 AppStream 26 k libdmx x86_64 1.1.4-3.el8 AppStream 22 k Transaction Summary ========================================================================================================== Install 3 Packages Total download size: 184 k Installed size: 386 k Downloading Packages: (1/3): xorg-x11-utils-7.5-28.el8.x86_64.rpm 3.6 MB/s | 136 kB 00:00 (2/3): libXxf86dga-1.1.5-1.el8.x86_64.rpm 535 kB/s | 26 kB 00:00 (3/3): libdmx-1.1.4-3.el8.x86_64.rpm 231 kB/s | 22 kB 00:00 ---------------------------------------------------------------------------------------------------------- Total 1.9 MB/s | 184 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : libdmx-1.1.4-3.el8.x86_64 1/3 Installing : libXxf86dga-1.1.5-1.el8.x86_64 2/3 Installing : xorg-x11-utils-7.5-28.el8.x86_64 3/3 Error unpacking rpm package xorg-x11-utils-7.5-28.el8.x86_64 Running scriptlet: xorg-x11-utils-7.5-28.el8.x86_64 3/3 error: unpacking of archive failed on file /usr/bin/edid-decode;6902b6c3: cpio: open error: xorg-x11-utils-7.5-28.el8.x86_64: install failed Verifying : libXxf86dga-1.1.5-1.el8.x86_64 1/3 Verifying : libdmx-1.1.4-3.el8.x86_64 2/3 Verifying : xorg-x11-utils-7.5-28.el8.x86_64 3/3 Installed: libXxf86dga-1.1.5-1.el8.x86_64 libdmx-1.1.4-3.el8.x86_64 Failed: xorg-x11-utils-7.5-28.el8.x86_64 Error: Transaction failed [root@yfw xvfb-extract]# [root@yfw xvfb-extract]# # 测试连接 [root@yfw xvfb-extract]# su -s /bin/bash openfire -c 'DISPLAY=:99 xdpyinfo | grep -i dimensions' bash: xdpyinfo: command not found [root@yfw xvfb-extract]# yum install -y xkeyboard-config xorg-x11-xkb-utils Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 1:14:33 ago on Thu Oct 30 07:39:51 2025. Package xkeyboard-config-2.28-1.el8.noarch is already installed. Dependencies resolved. ========================================================================================================== Package Architecture Version Repository Size ========================================================================================================== Installing: xorg-x11-xkb-utils x86_64 7.7-28.el8 AppStream 114 k Transaction Summary ========================================================================================================== Install 1 Package Total download size: 114 k Installed size: 250 k Downloading Packages: xorg-x11-xkb-utils-7.7-28.el8.x86_64.rpm 3.7 MB/s | 114 kB 00:00 ---------------------------------------------------------------------------------------------------------- Total 3.6 MB/s | 114 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : xorg-x11-xkb-utils-7.7-28.el8.x86_64 1/1 Error unpacking rpm package xorg-x11-xkb-utils-7.7-28.el8.x86_64 Verifying : xorg-x11-xkb-utils-7.7-28.el8.x86_64 1/1 Failed: xorg-x11-xkb-utils-7.7-28.el8.x86_64 Error: Transaction failed [root@yfw xvfb-extract]# which xkbcomp /usr/bin/which: no xkbcomp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin) [root@yfw xvfb-extract]# # 应输出:/usr/bin/xkbcomp [root@yfw xvfb-extract]# yum install -y xorg-x11-xkb-utils Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 1:16:05 ago on Thu Oct 30 07:39:51 2025. Dependencies resolved. ========================================================================================================== Package Architecture Version Repository Size ========================================================================================================== Installing: xorg-x11-xkb-utils x86_64 7.7-28.el8 AppStream 114 k Transaction Summary ========================================================================================================== Install 1 Package Total download size: 114 k Installed size: 250 k Downloading Packages: xorg-x11-xkb-utils-7.7-28.el8.x86_64.rpm 6.9 MB/s | 114 kB 00:00 ---------------------------------------------------------------------------------------------------------- Total 6.5 MB/s | 114 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : xorg-x11-xkb-utils-7.7-28.el8.x86_64 1/1 Error unpacking rpm package xorg-x11-xkb-utils-7.7-28.el8.x86_64 Verifying : xorg-x11-xkb-utils-7.7-28.el8.x86_64 1/1 Failed: xorg-x11-xkb-utils-7.7-28.el8.x86_64 Error: Transaction failed [root@yfw xvfb-extract]# which xkbcomp /usr/bin/which: no xkbcomp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin) [root@yfw xvfb-extract]#
最新发布
10-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值