Discussion:
Config for Tika Windows Service with Apache Commons Daemon
Jason
2015-03-04 06:06:37 UTC
Permalink
I'm trying to get Tika JAXRS running as a Windows Service using Apache
Commons Daemon.

I've got tika-server-1.7.jar from http://tika.apache.org/download.html

I've downloaded v1.0.15 of the Windows binaries for Apache Commons Daemon
from http://commons.apache.org/proper/commons-daemon/binaries.html

I can get Tika started as a service, but I can't determine what to use for
a stop method.

prunsrv.exe //IS//tika-daemon --DisplayName "Tika Daemon" --Classpath
"C:\Tika Service\tika-server-1.7.jar" --StartClass
"org.apache.tika.server.TikaServerCli" --StopClass
"org.apache.tika.server.TikaServerCli" --StartMethod main --StopMethod main
--Description "Tika Daemon Windows Service" --StartMode java --StopMode java

This starts, and works as I'd hope, but when trying to stop the service it
doesn't respond. Obviously
org.apache.tika.server.TikaServerCli.main(string[] args) isn't a suitable
stop method, but I'm lost for alternatives.

I'd also welcome any alternative methods for getting Tika running as a
Windows Service, or otherwise auto-starting outside of an interactive
session.
Nick Burch
2015-03-04 06:21:38 UTC
Permalink
Post by Jason
I can get Tika started as a service, but I can't determine what to use for
a stop method.
There isn't really a stop method. As it stands, the Tika Server runs in a
single process, started from the main method. To close it down, send it
control+c or a kill signal
Post by Jason
prunsrv.exe //IS//tika-daemon --DisplayName "Tika Daemon" --Classpath
"C:\Tika Service\tika-server-1.7.jar" --StartClass
"org.apache.tika.server.TikaServerCli" --StopClass
"org.apache.tika.server.TikaServerCli" --StartMethod main --StopMethod main
--Description "Tika Daemon Windows Service" --StartMode java --StopMode java
At first glance, that looks like the settings for starting and stopping a
service which forks into the background, which isn't quite what you need
for the Tika Server.

Maybe the fix is for you to help with the "war" mode for Tika (TIKA-894),
then deploy that the normal way for Tomcat or Jetty?

Nick
Allison, Timothy B.
2015-03-04 12:07:38 UTC
Permalink
Somewhere on my todo list is to add the ability to stop tika-server on the commandline. I probably won't get to this for a few months, though.

I agree with Nick's recommendation to contribute to the war, if at all possible.

-----Original Message-----
From: Nick Burch [mailto:***@gagravarr.org]
Sent: Wednesday, March 04, 2015 1:22 AM
To: ***@tika.apache.org
Subject: Re: Config for Tika Windows Service with Apache Commons Daemon
Post by Jason
I can get Tika started as a service, but I can't determine what to use for
a stop method.
There isn't really a stop method. As it stands, the Tika Server runs in a
single process, started from the main method. To close it down, send it
control+c or a kill signal
Post by Jason
prunsrv.exe //IS//tika-daemon --DisplayName "Tika Daemon" --Classpath
"C:\Tika Service\tika-server-1.7.jar" --StartClass
"org.apache.tika.server.TikaServerCli" --StopClass
"org.apache.tika.server.TikaServerCli" --StartMethod main --StopMethod main
--Description "Tika Daemon Windows Service" --StartMode java --StopMode java
At first glance, that looks like the settings for starting and stopping a
service which forks into the background, which isn't quite what you need
for the Tika Server.

Maybe the fix is for you to help with the "war" mode for Tika (TIKA-894),
then deploy that the normal way for Tomcat or Jetty?

Nick
Mattmann, Chris A (3980)
2015-03-07 15:53:35 UTC
Permalink
Hi Jason, this sounds awesome.

Sorry it’s taken so long to reply. I don’t think we have a stop
function available in the server. Can you file a ticket here:

https://issues.apache.org/jira/browse/TIKA

And then request that we add one? I’ll try and whip up a quick patch
for this..

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: ***@nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Jason <***@gmail.com>
Reply-To: "***@tika.apache.org" <***@tika.apache.org>
Date: Tuesday, March 3, 2015 at 10:06 PM
To: "***@tika.apache.org" <***@tika.apache.org>
Subject: Config for Tika Windows Service with Apache Commons Daemon
Post by Jason
I'm trying to get Tika JAXRS running as a Windows Service using Apache
Commons Daemon.
I've got tika-server-1.7.jar from http://tika.apache.org/download.html
I've downloaded v1.0.15 of the Windows binaries for Apache Commons Daemon
from http://commons.apache.org/proper/commons-daemon/binaries.html
I can get Tika started as a service, but I can't determine what to use
for a stop method.
prunsrv.exe //IS//tika-daemon --DisplayName "Tika Daemon" --Classpath
"C:\Tika Service\tika-server-1.7.jar" --StartClass
"org.apache.tika.server.TikaServerCli" --StopClass
"org.apache.tika.server.TikaServerCli" --StartMethod main --StopMethod
main --Description
"Tika Daemon Windows Service" --StartMode java --StopMode java
This starts, and works as I'd hope, but when trying to stop the service
it doesn't respond. Obviously
org.apache.tika.server.TikaServerCli.main(string[] args) isn't a suitable
stop method, but I'm lost for alternatives.
I'd also welcome any alternative methods for getting Tika running as a
Windows Service, or otherwise auto-starting outside of
Jason
2015-03-10 02:26:17 UTC
Permalink
Thanks Chris, a "Stop" method would make Daemon integration a cinch, so I'd
love to see that.
Ticket raised:
https://issues.apache.org/jira/browse/TIKA-1570

Regards,
Jason.
Mattmann, Chris A (3980)
2015-03-10 14:39:25 UTC
Permalink
Thanks Jason. I’ll work on this today.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Chief Architect
Instrument Software and Science Data Systems Section (398)
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 168-519, Mailstop: 168-527
Email: ***@nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Associate Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-----Original Message-----
From: Jason <***@gmail.com>
Reply-To: "***@tika.apache.org" <***@tika.apache.org>
Date: Monday, March 9, 2015 at 7:26 PM
To: "***@tika.apache.org" <***@tika.apache.org>
Subject: Re: Config for Tika Windows Service with Apache Commons Daemon
Post by Jason
Thanks Chris, a "Stop" method would make Daemon integration a cinch, so
I'd love to see that.
https://issues.apache.org/jira/browse/
Loading...