-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
atlantis with upstart on ubuntu 14.04
Signed-off-by: Ben Abrams <me@benabrams.it>
- Loading branch information
1 parent
5667275
commit 13b10a8
Showing
6 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
property :atlantis_service_template_variables, Hash, default: { | ||
:atlantis_user => 'atlantis', | ||
:atlantis_bin_location => '/usr/local/bin/atlantis', | ||
:atlantis_config_name => 'atlantis.yaml', | ||
:atlantis_home => '/opt/atlantis', | ||
:timeout_stop_sec => 5, | ||
} | ||
property :atlantis_service_template_cookbook, String, default: 'atlantis' | ||
property :atlantis_user, String, default: 'atlantis' | ||
|
||
default_action :setup | ||
|
||
action :setup do | ||
template 'atlantis.upstart.conf' do | ||
cookbook new_resource.atlantis_service_template_cookbook | ||
path '/etc/init/atlantis.conf' | ||
action :create | ||
variables(vars: new_resource.atlantis_service_template_variables) | ||
end | ||
|
||
service 'atlantis' do | ||
action [:enable, :start] | ||
provider Chef::Provider::Service::Upstart | ||
end | ||
end | ||
|
||
action :remove do | ||
file '/etc/init/atlantis.conf' do | ||
action :delete | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
description "Atlantis" | ||
|
||
start on runlevel [2345] | ||
stop on runlevel [06] | ||
|
||
respawn | ||
respawn limit 10 10 | ||
|
||
umask 022 | ||
|
||
chdir <%= @vars[:atlantis_home] || '/opt/atlantis' %> | ||
env GOMAXPROCS="2" | ||
env PATH="/usr/local/bin:/usr/bin:/bin:/sbin" | ||
|
||
kill signal TERM | ||
kill timeout <%= @vars[:timeout_stop_sec] || 5 %> | ||
reload signal HUP | ||
|
||
script | ||
# debug | ||
set -x | ||
|
||
# start the service | ||
exec start-stop-daemon --start --chuid <%= @vars[:atlantis_user] %> --exec <%= @vars[:atlantis_bin_location] %> -- server --config <%= @vars[:atlantis_home] %>/<%= @vars[:atlantis_config_name] %> | ||
end script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters