Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd support #45

Merged
merged 2 commits into from Sep 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .kitchen.yml
Expand Up @@ -23,6 +23,15 @@ platforms:
driver:
box: chef/ubuntu-14.04
image: ubuntu-14-04-x64
- name: ubuntu-15.04
driver:
box: chef/ubuntu-15.04
image: ubuntu-15-04-x64
attributes:
postgresql:
# postgresql cookbook doesn't support 15.04 yet.
version: '9.4'
enable_pgdg_apt: false

provisioner:
name: chef_zero
Expand Down Expand Up @@ -63,6 +72,7 @@ suites:
type: postgresql
install_type: standalone
java:
java_home: /usr/lib/jvm/java-8-oracle
jdk_version: 8
postgresql:
password:
Expand Down
28 changes: 24 additions & 4 deletions recipes/linux_installer.rb
Expand Up @@ -61,10 +61,30 @@
mysql_connector_j "#{node['confluence']['install_path']}/lib"
end

template '/etc/init.d/confluence' do
source 'confluence.init.erb'
mode '0755'
notifies :restart, 'service[confluence]', :delayed
if node['init_package'] == 'systemd'
execute 'systemctl-daemon-reload' do
command '/bin/systemctl --system daemon-reload'
action :nothing
end

template '/etc/systemd/system/confluence.service' do
source 'confluence.systemd.erb'
owner 'root'
group 'root'
mode 00755
action :create
notifies :run, 'execute[systemctl-daemon-reload]', :immediately
notifies :restart, 'service[confluence]', :delayed
end
else
template '/etc/init.d/confluence' do
source 'confluence.init.erb'
owner 'root'
group 'root'
mode 00755
action :create
notifies :restart, 'service[confluence]', :delayed
end
end

service 'confluence' do
Expand Down
28 changes: 24 additions & 4 deletions recipes/linux_standalone.rb
Expand Up @@ -66,10 +66,30 @@
mysql_connector_j "#{node['confluence']['install_path']}/lib"
end

template '/etc/init.d/confluence' do
source 'confluence.init.erb'
mode '0755'
notifies :restart, 'service[confluence]', :delayed
if node['init_package'] == 'systemd'
execute 'systemctl-daemon-reload' do
command '/bin/systemctl --system daemon-reload'
action :nothing
end

template '/etc/systemd/system/confluence.service' do
source 'confluence.systemd.erb'
owner 'root'
group 'root'
mode 00755
action :create
notifies :run, 'execute[systemctl-daemon-reload]', :immediately
notifies :restart, 'service[confluence]', :delayed
end
else
template '/etc/init.d/confluence' do
source 'confluence.init.erb'
owner 'root'
group 'root'
mode 00755
action :create
notifies :restart, 'service[confluence]', :delayed
end
end

service 'confluence' do
Expand Down
13 changes: 13 additions & 0 deletions templates/default/confluence.systemd.erb
@@ -0,0 +1,13 @@
[Unit]
Description=Confluence Team Collaboration Software
After=network.target

[Service]
Type=forking
User=<%= node['confluence']['user'] %>
PIDFile=<%= node['confluence']['install_path'] %>/work/catalina.pid
ExecStart=<%= node['confluence']['install_path'] %>/bin/start-confluence.sh
ExecStop=<%= node['confluence']['install_path'] %>/bin/stop-confluence.sh

[Install]
WantedBy=multi-user.target