Libre Office 4.2.0 as windows service on windows server 2008 R2 Server Issue

Hi Support Team,

  We are trying to setup Libre Office as windows service on windows server 2008 R2 Server, using following entry on regedit, but after this service not get started.

C:\Program Files (x86)\LibreOffice 4\program\ soffice.exe -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"

    Can you please help me to setup LibreOffice_4.2.0 as a windows service or please send me steps.

Regard's,

Anil Wale | Senior Product Engineer - Paxpro
anil_wale@persistent.co.in.|Tel<mailto:anil_wale@persistent.co.in.%7CTel> :-+91 (20) 302 35441|Mobile:-9860862389
Persistent Systems Ltd. | 20 Glorious Years | www.persistentsys.com<http://www.persistentsys.com/>

DISCLAIMER

Windows can not even start a simple Java program as a service. I think
this is intentional. Help yourself with some auto-start scripts.

Anil Wale wrote:

> Hi Support Team,
>
> We are trying to setup Libre Office as windows service on windows server 2008 R2 Server, using following entry on regedit, but after this service not get started.
>
> C:\Program Files (x86)\LibreOffice 4\program\ soffice.exe -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"
>
> Can you please help me to setup LibreOffice_4.2.0 as a windows service or please send me steps.

I don't use Windows, so I can't tell for sure, but anyway, LibreOffice uses double hyphens: --headless --nofirststartwizard --accept=. Single - is OpenOffice Speak. I would also add --nologo myself.

Hi :slight_smile:
Ahh, that is an interesting divergence!

With all those spaces in it does it need some escape characters or
speech-marks or anything? Errr, i guess that's a linuxy issue but does
Windows suffer too?
Regards from
Tom :slight_smile:

Anil Wale wrote:

Hi Support Team,

   We are trying to setup Libre Office as windows service on windows server 2008 R2 Server, using following entry on regedit, but after this service not get started.

C:\Program Files (x86)\LibreOffice 4\program\ soffice.exe -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;StarOffice.Service"

     Can you please help me to setup LibreOffice_4.2.0 as a windows service or please send me steps.

I don't even know if LibreOffice can be run as a Windows service. Perhaps someone else here might know. You can't just run any random program as a service - it has to be designed to respond to the commands to start and stop the service, and probably some other things. Assuming LibreOffice can run as a service, configuring a service needs more than just a single value in the registry; e.g. there are others specifying whether the service should automatically start, what happens on errors, etc.

There are several problems with that command anyway:
- With spaces in the path to the executable, that has to be enclosed in double-quotes ("). As it is, Windows will try starting C:\Program (which probably doesn't even exist) as an executable, passing the rest as parameters.
- There should not be a space between "program\" and "soffice.exe".
- As Piet mentioned, it looks like double hyphens are needed for LibreOffice parameters:

https://help.libreoffice.org/Common/Starting_the_Software_With_Parameters

So that would be:
"C:\Program Files (x86)\LibreOffice 4\program\soffice.exe" --headless --nofirststartwizard --accept="socket,host=localhost,port=8100;urp;StarOffice.Service"

Rather than setting up a service, it's probably easiest to just auto-run that command by adding an entry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\ - create a string value with whatever name you like (e.g. "LibreOffice Service") and the command as the data. Before doing that though, it's probably easiest to experiment and make sure the intended command works by running it from a command prompt. If you did that with your command, it outputs:
   'C:\Program' is not recognized...
giving a pretty good hint to the first problem.

Mark.