-
Notifications
You must be signed in to change notification settings - Fork 39
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
Set default PATH for cron or full path to backup executable? #16
Comments
If the place where gems get installed isn't in the default path, then this is what's going to happen. Telling it to use |
All my stuff is in shell default paths:
Thing is, CRON does not have the same default PATH as an interactive shell, i.e From the CRON man, we can read: So only calling backup, no matter if my gem is in my default interactive shell PATH, it won't work. |
I agree, the cron PATH should be updated for |
On my system there is not Ruby system wide instaled. So even adding How ever I would rather install Backup to system wide ruby installation. So sth. like rbenv cookbook shold be dependency of this one. |
+1 for this, i have to use: cron_options({
path: '/opt/chef/embedded/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
}) |
My colleague, @neilh23, has raised an issue where backup is failing to start because it cannot find builder 3.2.2. It has installed the backup gem under This made me wonder whether it's even supposed to install the gem there. This cookbook doesn't seem to suggest that. It uses On top of that, we have the comments above suggesting that the behaviour of # Opscode Omnibus - The ruby that ships inside omnibus is only used for Chef
# Default to installing somewhere more functional Given backup's insistence on very precise gem versions, I believe installing it alongside the Chef gems is a bad idea. We should at least make it possible to override |
I thought I'd try just installing a system-wide Ruby first and seeing whether it picks that instead. Indeed it does. I guess chef-client's behaviour did not change after all, but we should make it clearer that you should install Ruby before using this cookbook as it will not do it for you. The issue with the PATH still stands. |
Currently, the default command ran by the cron is
root backup perform --trigger my_backup --config-file /etc/backup/config.rb --log-path=/var/log > /dev/nu$
Thing is, this fail miserably because the PATH in a cron is not the same as the PATH in our shell, and the
backup
command is not found.I see two solutions here:
/usr/local/bin/backup
:path => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
My current solution is to set the
path
in thecron_options
parameters, i.eBut this is not really straightforward, since without this, the backup-cookbook cron simply does not work :)
Thoughts?
The text was updated successfully, but these errors were encountered: