Comments (14)
The underlying issue is this cookbook tries to start runsvdir using upstart, which fails under Docker. It should fall back to old-style sysv if possible.
from runit.
Merged #62 for corrections to this issue.
from runit.
@slyness Did you mean another ticket? #62 won't correct this, you need to change how runsvdir is launched under docker.
from runit.
Yes. Probably meant a different one. Sorry about that.
from runit.
I'm not sure if this is directly related but when trying to enable a service (genghis gem) inside a docker container I get:
docker: [2015-01-06T01:59:42+00:00] INFO: Processing runit_service[genghis] action enable (foobar::vagrant line 10)
docker: [2015-01-06T01:59:42+00:00] INFO: Processing directory[/etc/sv/genghis] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis] created directory /etc/sv/genghis
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis] mode changed to 755
docker: [2015-01-06T01:59:42+00:00] INFO: Processing template[/etc/sv/genghis/run] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/run] created file /etc/sv/genghis/run
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/run] updated file contents /etc/sv/genghis/run
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/run] mode changed to 755
docker: [2015-01-06T01:59:42+00:00] INFO: Processing directory[/etc/sv/genghis/log] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis/log] created directory /etc/sv/genghis/log
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis/log] mode changed to 755
docker: [2015-01-06T01:59:42+00:00] INFO: Processing directory[/etc/sv/genghis/log/main] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis/log/main] created directory /etc/sv/genghis/log/main
docker: [2015-01-06T01:59:42+00:00] INFO: directory[/etc/sv/genghis/log/main] mode changed to 755
docker: [2015-01-06T01:59:42+00:00] INFO: Processing template[/etc/sv/genghis/log/run] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/run] created file /etc/sv/genghis/log/run
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/run] updated file contents /etc/sv/genghis/log/run
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/run] mode changed to 755
docker: [2015-01-06T01:59:42+00:00] INFO: Processing template[/etc/sv/genghis/log/config] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/config] created file /etc/sv/genghis/log/config
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/config] updated file contents /etc/sv/genghis/log/config
docker: [2015-01-06T01:59:42+00:00] INFO: template[/etc/sv/genghis/log/config] mode changed to 644
docker: [2015-01-06T01:59:42+00:00] INFO: Processing link[/etc/init.d/genghis] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: link[/etc/init.d/genghis] created
docker: [2015-01-06T01:59:42+00:00] INFO: runit_service[genghis] configured
docker: [2015-01-06T01:59:42+00:00] INFO: Processing link[/etc/service/genghis] action create (dynamically defined)
docker: [2015-01-06T01:59:42+00:00] INFO: link[/etc/service/genghis] created
docker: [2015-01-06T01:59:42+00:00] INFO: runit_service[genghis] enabled
docker:
docker: ================================================================================
docker: Error executing action `enable` on resource 'runit_service[genghis]'
docker: ================================================================================
docker:
docker: Mixlib::ShellOut::ShellCommandFailed
docker: ------------------------------------
docker: Expected process to exit with [0], but received '1'
docker: ---- Begin output of /usr/bin/sv restart /etc/service/genghis ----
docker: STDOUT: warning: /etc/service/genghis: unable to open supervise/ok: file does not exist
docker: STDERR:
docker: ---- End output of /usr/bin/sv restart /etc/service/genghis ----
docker: Ran /usr/bin/sv restart /etc/service/genghis returned 1
docker:
docker: Cookbook Trace:
docker: ---------------
docker: /tmp/packer-chef-solo/cookbooks-0/runit/libraries/provider_runit_service.rb:195:in `restart_service'
docker: /tmp/packer-chef-solo/cookbooks-0/runit/libraries/provider_runit_service.rb:98:in `action_enable'
docker:
docker: Resource Declaration:
docker: ---------------------
docker: # In /tmp/packer-chef-solo/cookbooks-0/foobar/recipes/vagrant.rb
docker:
docker: 10: runit_service "genghis" do
docker: 11: action [ :enable ]
docker: 12: end
docker: 13:
docker:
docker: Compiled Resource:
docker: ------------------
docker: # Declared in /tmp/packer-chef-solo/cookbooks-0/foobar/recipes/vagrant.rb:10:in `from_file'
docker:
docker: runit_service("genghis") do
docker: provider Chef::Provider::Service::Runit
docker: action [:enable]
docker: supports {:restart=>true, :reload=>true, :status=>true}
docker: retries 0
docker: retry_delay 2
docker: default_guard_interpreter :default
docker: service_name "genghis"
docker: enabled true
docker: pattern "genghis"
docker: status_command "/usr/bin/sv status /etc/service"
docker: sv_bin "/usr/bin/sv"
docker: sv_dir "/etc/sv"
docker: service_dir "/etc/service"
docker: lsb_init_dir "/etc/init.d"
docker: log true
docker: restart_on_update true
docker: run_template_name "genghis"
docker: log_template_name "genghis"
docker: check_script_template_name "genghis"
docker: finish_script_template_name "genghis"
docker: sv_templates true
docker: service_mirror # Declared in
docker:
docker: service("genghis") do
docker: provider Chef::Provider::Service::Simple
docker: action [:nothing]
docker: supports {:restart=>true, :reload=>true, :status=>true}
docker: retries 0
docker: retry_delay 2
docker: default_guard_interpreter :default
docker: service_name "genghis"
docker: pattern "genghis"
docker: start_command "/usr/bin/sv start /etc/service/genghis"
docker: stop_command "/usr/bin/sv stop /etc/service/genghis"
docker: status_command "/usr/bin/sv status /etc/service/genghis"
docker: restart_command "/usr/bin/sv restart /etc/service/genghis"
docker: end
docker:
docker: declared_type :runit_service
docker: cookbook_name :foobar
docker: recipe_name "vagrant"
docker: end
docker:
docker: [2015-01-06T01:59:42+00:00] INFO: Running queued delayed notifications before re-raising exception
docker: [2015-01-06T01:59:42+00:00] ERROR: Running exception handlers
docker: [2015-01-06T01:59:42+00:00] ERROR: Exception handlers complete
docker: [2015-01-06T01:59:42+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
docker: [2015-01-06T01:59:42+00:00] ERROR: runit_service[genghis] (foobar::vagrant line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
docker: ---- Begin output of /usr/bin/sv restart /etc/service/genghis ----
docker: STDOUT: warning: /etc/service/genghis: unable to open supervise/ok: file does not exist
docker: STDERR:
docker: ---- End output of /usr/bin/sv restart /etc/service/genghis ----
docker: Ran /usr/bin/sv restart /etc/service/genghis returned 1
docker: [2015-01-06T01:59:42+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
I'm using version 1.5.12 of the runit cookbook
For some reason the "supervise/ok" file is missing. Any ideas about this?
from runit.
It is related. Taking out the check for the supervise/ok file causes the restart to happen before runsvdir actually initializes the service directory. I don't think the problem is in the check it is getting runsvdir started properly inside docker as @coderanger said.
I use a custom container that has runit pre-installed and starts runsvdir as the first process for most of my tests and I have had to pin to 1.5.10 to keep my tests from breaking.
from runit.
@nhuff how do you solved this?
from runit.
I'm also affected by this.
Any one with a fix or hack?
Is this helpful to find a solution? https://projects.puppetlabs.com/issues/4480
from runit.
Have you tried the latest version of the cookbook?
from runit.
I was running 1.5.16 for a long time and haven't seen the issue but after I've upgraded runit cookbook to the latest 1.7.2 (older one doesn't work with Chef 12.4.0) I start to see this error too.
from runit.
A small update: I'm not running docker but a plain Ubuntu.
I've noticed a very weird thing.
I've tried uncommenting the following lines
https://github.com/hw-cookbooks/runit/blob/develop/libraries/provider_runit_service.rb#L247-L249
and after that Chef run starts to freeze.
I've looked into /etc/service
dir and there is no symlink created by this resource.
(https://github.com/hw-cookbooks/runit/blob/develop/libraries/provider_runit_service.rb#L241-L244)
And that is likely a cause of freezing.
If I comment the lines back and run the same resource provision again there is symlink.
I've tried these 2 cases on fresh vagrant machines so there should not be influence between runs on each other. Both runs were Ubuntu 12.04 running on AWS
from runit.
As a workaround for now, the following works:
runit_service "myservice" do
# ...
sv_bin 'sleep 5 && /usr/bin/sv'
action :enable
end
from runit.
@jtimberman Same issue with the latest version (1.7.2).
I think #148 is the duplicate.
Workaround doesn't seem to work neither.
What I try to do is this (aka steps to reproduce):
FROM phusion/baseimage:0.9.16
RUN apt-get -yqq update
RUN apt-get -yqq install curl lsb-release wget
RUN curl -L https://getchef.com/chef/install.sh | bash -s -- -v 12.1.0
RUN apt-get -yqq clean
RUN mkdir -p /var/chef/cache /var/chef/cookbooks
RUN wget -qO- https://supermarket.chef.io/cookbooks/chef-server/download | tar xvzC /var/chef/cookbooks
RUN for dep in chef-ingredient yum-chef yum apt-chef apt packagecloud ; do wget -qO- https://supermarket.chef.io/cookbooks/${dep}/download | tar xvzC /var/chef/cookbooks ; done
RUN chef-solo -o 'recipe[chef-server]'
CMD /sbin/my_init /init.sh
from runit.
I believe this issue is solved by #193. Please use a docker container as now described in the README.
from runit.
Related Issues (20)
- Release develop contents HOT 2
- sv_timeout for RHEL HOT 1
- `env` attribute not compatible with `lazy` HOT 4
- Source repo should be configurable instead of hardcoded to packagecloud HOT 4
- init script: 'status' always returns 0 HOT 1
- Provider waits forever if runit isn't installed HOT 1
- Entering infinite loop during run HOT 12
- runit_service resource does not create service HOT 5
- chef-server-ctl reconfigure failed in Ubuntu 14.04, chef v12.3.1 HOT 2
- User controller service creation blocked forever (Debian Stretch 9.0) HOT 2
- Runit doesn't start automatically at system startup anymore (Debian Stretch 9.0) HOT 3
- Runit not installed on Amazon Linux under Chef 13 HOT 2
- Runit not getting installed HOT 2
- runit version 4.0.0 breaks chefspec in consuming cookbook HOT 1
- Upgrading runit cookbook to version >= 4.0.0 breaks ChefSpec configurations with multiple contexts HOT 2
- superclass mismatch for class RunitService HOT 7
- Error executing action `start` on resource 'service[runsvdir-start]' STDERR: start: Unknown job: runsvdir-start HOT 8
- initial cookbook runs intermittently breaking yum HOT 1
- Runit-5.0.0 breaks chefspec tests HOT 7
- docker stop/kill,and runit procees is exit. which accept singal for the children process
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runit.