Reputation: 1861
In the case when I first ssh to the server and then run command, it executes successfully
root@chef:~# chef-solo -v
Chef: 11.10.0
But when I try to run it like this
ssh [email protected] -t -C "chef-solo -c /var/chef/solo.rb"
I receive an error:
bash: chef-solo: command not found
Why is this happening, and how can I solve this issue ?
Upvotes: 1
Views: 844
Reputation: 1763
It is still matter of $PATH
and ssh - not chef-solo. Interactive and non-interactive sessions not necessarily have same value for the $PATH
variable. Same ssh problem is described here on stackoverflow. You may also check GNU bash manual to have deeper insight of (non-)interactive and (non-)login shells. To shorten, solution would be one of the following:
$PATH
variable for both interactive and non-interactive shells.Note: To find out what's the absolute path, login to the machine via ssh and run which chef-solo
(Don't know how experienced you are with linux. Sorry if I'm underestimating your knowledge)
Upvotes: 1