Commit 0f99712e authored by Markus Guenther's avatar Markus Guenther
Browse files

[FEATURE] Use systemd to start tika server

parent 26bbc015
...@@ -24,4 +24,4 @@ default['tomcat']['webapp_dir'] = "/var/lib/tomcat#{node['tomcat']['base_version ...@@ -24,4 +24,4 @@ default['tomcat']['webapp_dir'] = "/var/lib/tomcat#{node['tomcat']['base_version
default['typo3_solr']['solr']['solr_home'] = '/srv/solr' default['typo3_solr']['solr']['solr_home'] = '/srv/solr'
default['typo3_solr']['solr']['tika_home'] = '/srv/tika' default['typo3_solr']['solr']['tika_home'] = '/srv/tika'
default['typo3_solr']['solr']['etc_init'] = '/etc/init' default['typo3_solr']['solr']['systemd'] = '/lib/systemd/system'
\ No newline at end of file \ No newline at end of file
...@@ -224,10 +224,9 @@ action :add do ...@@ -224,10 +224,9 @@ action :add do
# tika server # tika server
template "#{node['typo3_solr']['solr']['etc_init']}/tika-server.conf" do template "#{node['typo3_solr']['solr']['systemd']}/tika-server.service" do
source 'tika-server.conf.erb' source 'tika-server.service.erb'
variables(:app => new_resource.tika_server) variables(:app => new_resource.tika_server)
owner node['tomcat']['user']
mode 0644 mode 0644
cookbook 'typo3_solr' cookbook 'typo3_solr'
end end
...@@ -239,6 +238,14 @@ action :add do ...@@ -239,6 +238,14 @@ action :add do
only_if { Gem::Version.new(new_resource.tika_server) > Gem::Version.new('0.0.0') } only_if { Gem::Version.new(new_resource.tika_server) > Gem::Version.new('0.0.0') }
end end
execute "enable tika-server" do
command "sudo systemctl enable tika-server.service"
end
execute "start tika-server" do
command "sudo systemctl start tika-server.service"
end
# reset directory access restrictions # reset directory access restrictions
......
description "Apache Tika Server"
start on filesystem or runlevel [2345]
stop on shutdown
respawn
respawn limit 3 12
exec java -jar <%= node['typo3_solr']['solr']['tika_home'] %>/tika-server-<%= @app %>.jar
\ No newline at end of file
[Unit]
Description=Apache Tika Server
[Service]
Type=forking
Restart=on-failure
ExecStart=/usr/bin/java -jar <%= node['typo3_solr']['solr']['tika_home'] %>/tika-server-<%= @app %>.jar
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment