Skip to content

Commit

Permalink
Better handling of pid_path
Browse files Browse the repository at this point in the history
This commit fixes sous-chefs#193
  • Loading branch information
kamaradclimber committed Mar 10, 2014
1 parent e65d06f commit 17f6ad0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@

# Create ES directories
#
[ node.elasticsearch[:path][:conf], node.elasticsearch[:path][:logs], node.elasticsearch[:pid_path] ].each do |path|
[ node.elasticsearch[:path][:conf], node.elasticsearch[:path][:logs] ].each do |path|
directory path do
owner node.elasticsearch[:user] and group node.elasticsearch[:user] and mode 0755
recursive true
action :create
end
end

directory node.elasticsearch[:pid_path] do
mode '0755'
recursive true
end

# Create data path directories
#
data_paths = node.elasticsearch[:path][:data].is_a?(Array) ? node.elasticsearch[:path][:data] : node.elasticsearch[:path][:data].split(',')
Expand Down
1 change: 1 addition & 0 deletions templates/default/elasticsearch.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ start() {
fi

echo -e "\033[1mStarting elasticsearch...\033[0m"
touch $PIDFILE && chown <%= node[:elasticsearch][:user] %> $PIDFILE
<% if node.platform_family == 'debian' %>
ES_INCLUDE=$ES_INCLUDE start-stop-daemon --background --start --quiet --pidfile $PIDFILE --chuid <%= node[:elasticsearch][:user] %> --exec /usr/local/bin/elasticsearch -- -p $PIDFILE
<% else %>
Expand Down

0 comments on commit 17f6ad0

Please sign in to comment.