Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

fix problems that arise when not root #33

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions definitions/bundle_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
# bundle install
execute 'bundle install' do
cwd params[:path]
command "bundle install"
if params[:user] == 'root'
command 'bundle install'
else
command 'bundle install --path vendor/bundle'
end
user params[:user]
only_if { File.directory?(params[:path]) }
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define :install_plugin do
define :newrelic_plugin do

tar_file = File.join(params[:install_path], "#{params[:name]}-#{params[:plugin_version]}.tar.gz")

Expand Down Expand Up @@ -38,4 +38,4 @@
only_if { File.directory?(params[:plugin_path]) && Dir.entries(params[:plugin_path]).sort == %w(. ..) }
end

end
end
2 changes: 1 addition & 1 deletion recipes/aws_cloudwatch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
package 'libxslt-devel'
end

install_plugin 'newrelic_aws_cloudwatch_plugin' do
newrelic_plugin 'newrelic_aws_cloudwatch_plugin' do
plugin_version node[:newrelic][:aws_cloudwatch][:version]
install_path node[:newrelic][:aws_cloudwatch][:install_path]
plugin_path node[:newrelic][:aws_cloudwatch][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_example_plugin' do
newrelic_plugin 'newrelic_example_plugin' do
plugin_version node[:newrelic][:example][:version]
install_path node[:newrelic][:example][:install_path]
plugin_path node[:newrelic][:example][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/memcached_java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_memcached_java_plugin' do
newrelic_plugin 'newrelic_memcached_java_plugin' do
plugin_version node[:newrelic][:memcached_java][:version]
install_path node[:newrelic][:memcached_java][:install_path]
plugin_path node[:newrelic][:memcached_java][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/memcached_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_memcached_ruby_plugin' do
newrelic_plugin 'newrelic_memcached_ruby_plugin' do
plugin_version node[:newrelic][:memcached_ruby][:version]
install_path node[:newrelic][:memcached_ruby][:install_path]
plugin_path node[:newrelic][:memcached_ruby][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_mysql_plugin' do
newrelic_plugin 'newrelic_mysql_plugin' do
plugin_version node[:newrelic][:mysql][:version]
install_path node[:newrelic][:mysql][:install_path]
plugin_path node[:newrelic][:mysql][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/rackspace_load_balancers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
package 'libxslt-devel'
end

install_plugin 'newrelic_rackspace_load_balancers_plugin' do
newrelic_plugin 'newrelic_rackspace_load_balancers_plugin' do
plugin_version node[:newrelic][:rackspace_load_balancers][:version]
install_path node[:newrelic][:rackspace_load_balancers][:install_path]
plugin_path node[:newrelic][:rackspace_load_balancers][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/wikipedia_example_java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_wikipedia_example_java_plugin' do
newrelic_plugin 'newrelic_wikipedia_example_java_plugin' do
plugin_version node[:newrelic][:wikipedia_example_java][:version]
install_path node[:newrelic][:wikipedia_example_java][:install_path]
plugin_path node[:newrelic][:wikipedia_example_java][:plugin_path]
Expand Down
2 changes: 1 addition & 1 deletion recipes/wikipedia_example_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

verify_license_key node[:newrelic][:license_key]

install_plugin 'newrelic_wikipedia_example_ruby_plugin' do
newrelic_plugin 'newrelic_wikipedia_example_ruby_plugin' do
plugin_version node[:newrelic][:wikipedia_example_ruby][:version]
install_path node[:newrelic][:wikipedia_example_ruby][:install_path]
plugin_path node[:newrelic][:wikipedia_example_ruby][:plugin_path]
Expand Down
4 changes: 2 additions & 2 deletions templates/default/service.erb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ start() {
echo "Starting $NAME"
cd $DAEMONDIR
touch $PIDFILE ; chown <%= @user %> $PIDFILE
su <%= @user %> -c "<%= @run_command %> $DAEMON >> $DAEMONDIR/plugin_daemon.log 2>&1 & echo \$! > $PIDFILE"
su <%= @user %> -s '/bin/bash' -c "<%= @run_command %> $DAEMON >> $DAEMONDIR/plugin_daemon.log 2>&1 & echo \$! > $PIDFILE"
Copy link

@neclimdul neclimdul Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's the problem I've been fighting with all afternoon.

fi
}

Expand Down Expand Up @@ -79,4 +79,4 @@ case "${1}" in
;;
esac

exit 0
exit 0