Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Usage instructions #102

Closed
synhershko opened this issue Aug 31, 2014 · 9 comments
Closed

Usage instructions #102

synhershko opened this issue Aug 31, 2014 · 9 comments

Comments

@synhershko
Copy link

Especially for the service recipe (how-to + exhibitor support).

Running it now (using a wrapper cookbook here: https://github.com/synhershko/Isengard.Cookbooks/blob/master/isengard-zookeeper/recipes/as_service.rb) I get:

================================================================================
Error executing action `enable` on resource 'runit_service[zookeeper]'
================================================================================


RuntimeError
------------
Could not locate main runit sv_bin at "/sbin/sv". Did you remember to install runit before declaring a "runit_service" resource? 

Try adding the following to the top of your recipe:

include_recipe "runit"


Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/runit/libraries/provider_runit_service.rb:71:in `load_current_resource'


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

46:   runit_service 'zookeeper' do
47:     default_logger true
48:     options({
49:       exec: executable_path
50:     })
51:     action [:enable, :start]
52:   end
53: when 'exhibitor'



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/zookeeper/recipes/service.rb:46:in `from_file'

runit_service("zookeeper") do
provider Chef::Provider::Service::Runit
action [:enable, :start]
supports {:restart=>true, :reload=>true, :status=>true}
retries 0
retry_delay 2
service_name "zookeeper"
pattern "zookeeper"
status_command "/sbin/sv status /etc/service"
sv_bin "/sbin/sv"
sv_dir "/etc/sv"
service_dir "/etc/service"
lsb_init_dir "/etc/init.d"
options {:exec=>"/opt/zookeeper/zookeeper-3.4.6/bin/zkServer.sh"}
log true
default_logger true
restart_on_update true
run_template_name "zookeeper"
log_template_name "zookeeper"
check_script_template_name "zookeeper"
finish_script_template_name "zookeeper"
sv_templates true
service_mirror # Declared in 

service("zookeeper") do
provider Chef::Provider::Service::Simple
action [:nothing]
supports {:restart=>true, :reload=>true, :status=>true}
retries 0
retry_delay 2
service_name "zookeeper"
pattern "zookeeper"
start_command "/sbin/sv start /etc/service/zookeeper"
stop_command "/sbin/sv stop /etc/service/zookeeper"
status_command "/sbin/sv status /etc/service/zookeeper"
restart_command "/sbin/sv restart /etc/service/zookeeper"
end

cookbook_name "zookeeper"
recipe_name "service"
end

It may be broken, but more lilkely I'm missing something

@jakedavis
Copy link
Contributor

Yeah, this is a bug I think. We'll need to add a depends on runit in the metadata and include_recipe 'runit::default' in the service recipe. This is actually slightly tricky because I believeeee adding that recipe would break our use case internally (not sure though), since when we set up the service we have some network restrictions that might prevent runit::default from being able to work. I'll get a PR going by Tuesday.

@synhershko
Copy link
Author

Cool. Is there a workaround i could use?
On Aug 31, 2014 7:12 PM, "Jake Davis" notifications@github.com wrote:

Yeah, this is a bug I think. We'll need to add a depends on runit in the
metadata and include_recipe 'runit::default' in the service recipe. This
is actually slightly tricky because I believeeee adding that recipe would
break our use case internally (not sure though), since when we set up the
service we have some network restrictions that might prevent runit::default
from being able to work. I'll get a PR going by Tuesday.


Reply to this email directly or view it on GitHub
#102 (comment)
.

@jakedavis
Copy link
Contributor

Yep. If you include_recipe 'runit::default' anytime before you call the service recipe, you're good to go.

synhershko added a commit to synhershko/Isengard.Cookbooks that referenced this issue Aug 31, 2014
@synhershko
Copy link
Author

Worked like a charm. I think the best resolution for this is to define this cookbook as one that needs to be wrapped, and having doco about how to install it as a service. While at it, doco on installing Exhibitor would be nice to have too!

@synhershko
Copy link
Author

Other items I'm missing docs for (not Chef / ruby expert) is how / where to set ZK's myid (if at all?), how to point it at fellow ensemble members, and how to use discover_zookeepers from other cookbooks (if it's still around at all?)

@jeffbyrnes
Copy link
Contributor

👍 for more docs. This is definitely a cookbook meant for wrapping, along with the exhibitor cookbook.

@jakedavis
Copy link
Contributor

Yo PRs accepted :) nah but I can try to work on this hopefully in the next couple of days. It definitely could use some improvements to the docs.

@jeffbyrnes
Copy link
Contributor

@jakedavis I'd be happy to help out, but currently grinding on some Archiva stuff :rage1:

@jeffbyrnes
Copy link
Contributor

Closing, as the README is pretty well-fleshed out now.

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

3 participants