我有一个网站依赖于在服务器模式下运行的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"
更多推荐
发布评论