fgrehm/vagrant-lxc

vagrant-lxc-wrapper shebang points to non existing /opt/vagrant/embedded/bin/ruby

Closed this issue · 5 comments

I have enabled the sudoer using vagrant lxc sudoers

$ vagrant up --provider=lxc --debug
DEBUG subprocess: stderr: sudo: unable to execute /usr/local/bin/vagrant-lxc-wrapper: No such file or directory
 INFO subprocess: Starting process: ["/usr/bin/sudo", "/usr/local/bin/vagrant-lxc-wrapper", "/usr/bin/which", "lxc-create"]
ERROR vagrant: The `lxc` package does not seem to be installed or is not accessible on the PATH.
$ head -n1 /usr/local/bin/vagrant-lxc-wrapper
#!/opt/vagrant/embedded/bin/ruby
$ stat /opt/vagrant/embedded/bin/ruby
stat: cannot stat ‘/opt/vagrant/embedded/bin/ruby’: No such file or directory

So in short the shebang in vagrant-lxc-1.1.0/templates/sudoers.rb.erb is hardcoded to #!/opt/vagrant/embedded/bin/ruby. Might be better to use /usr/bin/env ruby.


An interesting thing is that sudo reports a no such file or directory message which is confusing:

$ /usr/bin/sudo /usr/local/bin/vagrant-lxc-wrapper /usr/bin/which lxc-create
sudo: unable to execute /usr/local/bin/vagrant-lxc-wrapper: No such file or directory
$

ccope commented

The fix for this is in master: 05fdb3e

Yup, I'll try to cut a release with that next week, please ping me if I dont!

Ping @fgrehm :)

@fgrehm it is time for v1.1.1 :-}

Closing due to being fixed in master, will test everything until the weekend to make sure to have a stable release.