Openoffice

编程入门 行业动态 更新时间:2024-10-11 21:28:48
Openoffice - 在自定义Windows服务中运行soffice进程不在端口8100上侦听(Openoffice - running up soffice process in custom Windows service is not listening on port 8100)

我有一个网站依赖于在服务器模式下运行的openoffice将office文档转换为pdf文件。

我们可以使用批处理文件启动此过程,但该过程不能可靠地运行。

我尝试使用SRVANY创建一个服务来保持进程运行,但这并不能识别进程何时死机并且非常好地重新启动。

我使用System.Diagnostics.Process类在.Net中编写了一个服务 - 它为进程退出提供事件处理。

该服务启动正常并在我手动删除它时重新启动该过程,但现在流程本身存在问题。

我可以在进程中看到soffice.bin和soffice .exe,但是当我检查它是否正在侦听端口8100(netstat -a)时它不是(如果我用原始批处理手动启动进程)。

myProcess.StartInfo.CreateNoWindow = True myProcess.StartInfo.UseShellExecute = True myProcess.StartInfo.FileName =“c:\ Program Files(x86)\ OpenOffice.org 3 \ program \ soffice.exe”myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden myProcess.StartInfo.Arguments =“ - accept =”“socket,host = 127.0.0.1,port = 8100; urp;”“ - norestore - nofirststartwizard - headless - nologo”myProcess.EnableRaisingEvents = True myProcess.Start()

我试过设置.Domain .UserName .Password

管理员帐户,但没有运气。

如果我设置.UseShellExecute = False,则该进程根本不会启动。

我很感激任何建议让这个工作 - 或另一种方法来阻止在服务器模式下运行的openoffice消失(除了每5分钟重新启动一次计划任务...)

再次从这个站点http://support.etouch.net/cm/wiki/?id=34626尝试了SRVANY选项,但这也没有在端口8100上监听 - 这会在我的机器上提示一些东西(Server 2008 pc背后关闭Windows防火墙的公司防火墙)

I have a website that relies on openoffice running in server mode to convert office docs to pdf files.

We can start this process using a batch file, but the process doesn't stay running reliably.

I tried creating a service to keep the process running using SRVANY, but this didn't recognise when the process had died and restart itself very well.

I have written a service in .Net using System.Diagnostics.Process class - which has event handling for the process exiting.

The service starts ok and restarts the process when I manually remove it, but there's an issue with process itself now.

I can see soffice.bin and soffice .exe in processes, but when I check to see if it is listening on port 8100 (netstat -a) it isn't (it does if I start the process manually with original batch).

myProcess.StartInfo.CreateNoWindow = True myProcess.StartInfo.UseShellExecute = True myProcess.StartInfo.FileName = "c:\Program Files (x86)\OpenOffice.org 3\program\soffice.exe" myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden myProcess.StartInfo.Arguments = "-accept = ""socket,host=127.0.0.1,port=8100;urp;"" - norestore - nofirststartwizard - headless - nologo" myProcess.EnableRaisingEvents = True myProcess.Start()

I have tried setting .Domain .UserName .Password

to an admin account, but no luck.

If I set .UseShellExecute = False the process doesn't start at all.

I'd appreciate any suggestions to get this working - or another method to stop openoffice running in server mode from disappearing (apart from having a scheduled task that restarts it every 5 mins...)

Tried SRVANY option again from this site http://support.etouch.net/cm/wiki/?id=34626 but this doesn't have it listening on port 8100 either - which would suggest something on my machine (Server 2008 pc behind company firewall with windows firewall switched off)

最满意答案

引用“myProcess.StartInfo.Arguments”值看起来很可疑......检查一下。

myProcess.StartInfo.Arguments =“-headless -nologo -nodefault -invisible -nofirststartwizard -norestore -accept = socket,host = 127.0.0.1,port = 8100; urp”

The quoting of the "myProcess.StartInfo.Arguments" value looks suspicious... check on that.

myProcess.StartInfo.Arguments = "-headless -nologo -nodefault -invisible -nofirststartwizard -norestore -accept=socket,host=127.0.0.1,port=8100;urp"

更多推荐

本文发布于:2023-08-06 22:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1456357.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Openoffice

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!