Issue 100613 - Add support for registering OpenOffice as a Windows service
Summary: Add support for registering OpenOffice as a Windows service
Alias: None
Product: Installation
Classification: Application
Component: code (show other issues)
Version: OOO310m7
Hardware: Unknown Windows, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2009-03-27 15:30 UTC by oharboe
Modified: 2013-08-07 15:26 UTC (History)
2 users (show)

See Also:
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description oharboe 2009-03-27 15:30:56 UTC
When deploying OpenOffice in headless server mode it is necessary to launch
OpenOffice as a service.

I'd like to see an installation option to register OpenOffice as a service.
Below is a manual recipie to to this and needless to say it's quite involved.

<h2>Running OpenOffice as a service under Windows</h2>
The net is rife with recipies on how to do this and there may be
some simpler way of doing this, but as of writing this is the
recommended approach:

<li>Download and install <strong></strong> on your computer.</li>
<li>Create a user for service, e.g. <tt>openoffice</tt>.</li>

<li>Run <strong></strong> as <tt>openoffice</tt>. Right on
shortcut to <em> &gt; Run as&#8230;</em></li>
<li>Go through the first run wizard. Close <strong></strong>.</li>
<li>Open <em>Control Panel &gt; Administrative Tools &gt; Local Security

<li>Open <em>Security Settings &gt; Local Policies &gt; User Right Assigment
&gt; Log on as a service</em>. Add <tt>openoffice</tt>.</li>
<li>Download and install <strong>Windows Server 2003 Resource Kit
Tools</strong>. rktools.exe works on Windows XP Professional as well.</li>
<li>Read <a href="">How To Create a
User-Defined Service</a>.</li>

<li>Create a service named <tt>OpenOfficeService</tt> following the instructions
above. As the <tt>Application</tt> registry value use <tt>C:\Program
Files\ 3.0\program\soffice.exe</tt>.</li>
<li>Add another value to the <tt>Parameters</tt> key named
<tt>AppParameters</tt> and set it to:
<li><tt>-headless -accept=socket,port=2002;urp;</tt><br />
if you what to allow <strong></strong> accept connections only
from localhost,</li>

<li><tt>-headless -accept=socket,host=,port=2002;urp;</tt><br />
if you what to allow <strong></strong> accept connections from any
<li>Open <em>Control Panel &gt; Administrative Tools &gt; Services</em>.</li>

<li>Find <tt>OpenOfficeService</tt> and open its properties.</li>
<li>On <em>Log On</em> tab set <em>Log on as: This account</em> and specify
<li>Start service.</li>

<div>Some notes:</div>
<li>To check is our service running from a command prompt do:<br />
<code>&gt; netstat -anp tcp</code><br />
This shoud show a listening on port 2002.</li>
<li>If you use firewall, you may need to allow connections to port 2002.</li>
<li>You can remove <tt>openoffice</tt> from group <tt>Users</tt> to deny local
log in for this user.</li>


<h2>OpenOffice as a service troubleshooting</h2>
If conversion fails, then it might be because OpenOffice is trying to open some sort
of dialog box. Create an icon on the desktop with the argumetns above.
Create an shortcut on the desktop with the following arguments and right click and
"Run as" using the openoffice user. This will enable you to see the dialog boxes
that OpenOffice is trying to show.
"C:\Program Files\OOo-dev 3\program\soffice.exe" 
<h2>OpenOffice advanced configuration</h2>
You can configure the openoffice service to restart upon failure. Right click on 
services and enter the "Recovery" tab. Here you can set the service to restart
upon failure. However, this will fail as long as the srvany.exe application is
running. As of writing a there is no known method to make srvany.exe take advantage
robustly of the "Recovery" tab options.
Comment 1 Olaf Felka 2009-03-27 15:36:22 UTC
@ sb: Something for you?
Comment 2 oharboe 2009-03-27 15:45:24 UTC
Another comment regarding use of OpenOffice from Java:

one application(ours) is to convert files to PDF. This is done en masse in order
to be able to use e.g. Apache Lucene + Apache PDFBox to index & search files of
all sorts of different types.

Ideally I'd like to have a big openoffice.jar that I simply add to my
application like any other .jar file that I use for my application.

Comment 3 Stephan Bergmann 2009-03-27 16:14:25 UTC
@kso: please dispatch
Comment 4 kai.sommerfeld 2009-04-02 12:26:51 UTC
oharboe: Please don't use one single issue to report/request completely
unrelated fixes/features. Feel free to submit a seperate RFE for the OOo-Java
problem. But this task will only deal with the Windows-OOo-Service thing - as
its subject indicates.

ohraboe: Thanks for the recipe, much appreciated.

dv: Please take over. 
Comment 5 kai.sommerfeld 2009-04-02 12:31:00 UTC
Comment 6 dirk.voelzke 2009-04-09 07:05:07 UTC