centOS 服务器 openoffice 无头

发布于 2024-09-28 21:29:33 字数 587 浏览 1 评论 0原文

我正在尝试将 openOffice 作为 CentOS(非图形)服务器上的服务启动。

soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1

我怎么会遇到以下错误

 Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

[1]+  Done                    soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" 

这个命令在 Ubuntu 中运行得很好。
您能否建议我如何在 CentOS 服务器上将 OpenOffice 作为服务启动?

I am trying to start openOffice as a service on CentOS(non-graphical) server.

soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1

How ever I am getting below error

 Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

[1]+  Done                    soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" 

This command works just fine in Ubuntu.
Can you please suggest how can I start OpenOffice as a service on CentOS server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

⒈起吃苦の倖褔 2024-10-05 21:29:33

这对我在 CentOS 5 上有效:

  1. yum install openoffice.org-headless
  2. soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &

That works for me on CentOS 5:

  1. yum install openoffice.org-headless
  2. soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
赠佳期 2024-10-05 21:29:33

我不能 100% 确定这是否是问题所在,但可能是您的程序无法联系 X11 服务器,因为它是从 CLI 启动的。试试这个:

xhost +

这使得 Xorg 能够用于从 CLI 启动的应用程序。
我不确定它是否必须以 root 身份运行(IIRC,您不能以 root 身份运行它)。

I'm not 100% sure if this is the problem, but it might be that your program cannot contact the X11 server because it was launched from the CLI. Try this:

xhost +

That enables the use of Xorg for apps launched from the CLI.
I am not sure if it has to be ran as root or not (IIRC, you must NOT run it as root).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文