Skip to content

Runit support not working #156

@bilby91

Description

@bilby91

Brief Description

When trying to install Kafka and operate it using runit chef-client crashes.

Cookbook version

2.2.2

Chef-client version

14.12.9

Platform Details

cloud=aws
chef_version=14.12.9
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

Scenario

When trying to install Kafka and operate it using runit using the following attributes:

{
  "environment": "dev-us-east-1",
  "run_list": [
    "recipe[java]",
    "recipe[runit]",
    "recipe[kafka]"
  ],
  "normal": {
    "kafka": {
      "version": "0.8.2.2",
      "checksum": "6e75bb0e0438960aa668d0f9d570009647e457d74c377e4bbc508cec43ecf639",
      "init_style": "runit"
    }
  }
}

Steps to Reproduce

Use the above configuration

Expected Result

Install the recipe correctly and have kafka managed by runit.

Actual Result

Chef-client crashes with the following error:

================================================================================
Recipe Compile Error in /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/default.rb
================================================================================

TypeError
---------
no implicit conversion of nil into String

Cookbook Trace:
---------------
  /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/_service.rb:6:in `from_file'
  /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/default.rb:10:in `from_file'

Relevant File Content:
----------------------
/home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/_service.rb:

  1:  #
  2:  # Cookbook Name:: kafka
  3:  # Recipe:: _service
  4:  #
  5:
  6>> template kafka_init_opts[:env_path] do
  7:    source 'env.erb'
  8:    owner 'root'
  9:    group 'root'
 10:    mode '644'
 11:    helpers(Kafka::EnvFile)
 12:    if restart_on_configuration_change?
 13:      notifies :create, 'ruby_block[coordinate-kafka-start]', :immediately
 14:    end
 15:  end

The following init options don't contemplate runit but I found several places in the code base that reference runit support.

https://github.com/sous-chefs/kafka/blob/master/libraries/helpers.rb#L23

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workinghacktoberfestAn issue highlighted for the digital ocean Hacktoberfest Event

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions