Skip to content

Problem with providers/alternatives.rb #134

@cosenmarco

Description

@cosenmarco

Hi,
I'm having problems with alternatives on my vagrant box.

The VM is taken from here: "http://opscode-vagrant-boxes.s3.amazonaws.com/centos5-gems.box" (also had the same problem with another centos 5 image). I'm using chef_solo.

    chef.json = { :run_list => [ "recipe[java]" ],
     :java => {
       :jdk_version => 6,
       :install_flavor => "openjdk"
     }

How to reproduce:
1 - vagrant up
2 - vagrant provision

The second time provisioning runs you'll get this error:

...
[2014-02-07T11:11:30+00:00] DEBUG: Adding alternative for appletviewer
[2014-02-07T11:11:30+00:00] DEBUG: Setting alternative for appletviewer                                                                                                                                
[2014-02-07T11:11:30+00:00] FATAL:  set alternative failed
================================================================================                                                                                                                       
Error executing action `set` on resource 'java_alternatives[set-java-alternatives]'                                                                                                                    
================================================================================
...

I think the problem is due to the way "alternatives" behave when using "--install":

[vagrant@vagrant-c5-x86_64 ~]$ /usr/sbin/alternatives --version
alternatives version 1.3.30.2
[vagrant@vagrant-c5-x86_64 ~]$ sudo su -
[root@vagrant-c5-x86_64 ~]# /usr/sbin/alternatives --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/java-1.6.0/bin/appletviewer 1061 
failed to read link /usr/bin/appletviewer: No such file or directory
[root@vagrant-c5-x86_64 ~]# echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions