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)
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"