Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

ubuntu 14.4 + chef 11.10 (<12) ==> No such file or directory - /etc/init.d/mongod #30

Closed
tuky opened this issue Feb 12, 2016 · 3 comments

Comments

@tuky
Copy link

tuky commented Feb 12, 2016

Launching the service fails, because mongod 3.2.1 in ubuntu is an upstart service, but chef < 12 defaults to init.d for ubuntu 14.4.

Here is the relevant Chef stacktrace part:

================================================================================
Error executing action `restart` on resource 'service[mongod]'
================================================================================


Errno::ENOENT
-------------
No such file or directory - /etc/init.d/mongod


Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb

72: service 'mongod' do
73:   supports :start => true, :stop => true, :restart => true, :status => true
74:   action :enable
75:   subscribes :restart, "template[#{node['mongodb3']['mongod']['config_file']}]", :delayed
76:   subscribes :restart, "template[#{node['mongodb3']['config']['mongod']['security']['keyFile']}", :delayed
77: end



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb3/recipes/default.rb:72:in `from_file'

service("mongod") do
action [:enable]
supports {:start=>true, :stop=>true, :restart=>true, :status=>true}
retries 0
retry_delay 2
service_name "mongod"
pattern "mongod"
cookbook_name "mongodb3"
recipe_name "default"
end

This is pretty analogous to https://bugs.launchpad.net/openstack-chef/+bug/1313646
Would you consider to fix this here or at least document this incompatibilty?

@sunggun-yu
Copy link
Owner

Thank you for the issue reporting. I had no issue in my servers and kitchen testing with ubuntu 14.4 . but I'll try to replay this issue and fix it.

Thank you.

@tuky
Copy link
Author

tuky commented Feb 14, 2016

Thank you. It really boils down to chef version < 12. I try to deploy in AWS OpsWorks and sadly I am stuck with version 11.10. I could get it to work with Amazon Linux though.

@sunggun-yu
Copy link
Owner

uh, ok. I was excluding chef-client v11 testing for ubuntu 14.04
testing now.
https://github.com/sunggun-yu/chef-mongodb3/blob/master/.kitchen.yml

  - name: chef-client-11
    driver:
      vm_hostname: mongo3
    driver_config:
      require_chef_omnibus: 11.18.12
    run_list:
      - recipe[mongodb3::default]
    excludes:
      - debian-7.8
      - oel-6.6
      - ami-2014.03
      - ubuntu-14.04

sunggun-yu added a commit that referenced this issue Feb 14, 2016
Changing service provider as Chef::Provider::Service::Upstart for ubuntu 14.04
@sunggun-yu sunggun-yu mentioned this issue Feb 16, 2016
sunggun-yu added a commit that referenced this issue Feb 16, 2016
* Feature request #31 : Creating sysLog directory for mongod
* Fixing #30 : Changing service provider as `Chef::Provider::Service::Upstart` for ubuntu 14.04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants