Git Product home page Git Product logo

supervisor's Introduction

supervisor Cookbook

Build Status

Installs (Python) supervisor and provides resources to configure services

Requirements

Platforms

Supports Debian and RHEL based systems. Tested on Ubuntu 12.04, 10.04, CentOS 6.5.

Cookbooks

  • python

Attributes

  • node['supervisor']['inet_port'] - The port on which you want to serve the internal web-based admin dashboard, e.g. 'localhost:9001'

  • node['supervisor']['inet_username'] - The username for authentication to this HTTP server

  • node['supervisor']['inet_password'] - The password for authentication to this HTTP server (supports both cleartext and SHA-1 hashed passwords prefixed by {SHA})

  • node['supervisor']['dir'] - location of supervisor config files

  • node['supervisor']['log_dir'] - location of supervisor logs

  • node['supervisor']['logfile_maxbytes'] - max bytes for the supervisord logfile before it is rotated rotated, default '50MB'

  • node['supervisor']['logfile_backups'] - the number of backups of that logfile to keep, default 10

  • node['supervisor']['loglevel'] - the minimum severity for those log messages, default 'info'

  • node['supervisor']['minfds'] - The minimum number of file descriptors that must be available before supervisord will start successfully.

  • node['supervisor']['minprocs'] - The minimum number of process descriptors that must be available before supervisord will start successfully.

  • node['supervisor']['nocleanup'] - If true, retain child log files at startup, the default is false

  • node['supervisor']['version'] - Sets the version of supervisor to install, must be 3.0+ to use minprocs, minfds and nocleanup.

  • node['supervisor']['socket_file'] - location of supervisor socket file.

  • node['supervisor']['ctlplugins'] - entries for supervisorctl plugins. For instance, to install serialrestart, you'd manually add this to your config:

    [ctlplugin:serialrestart]
    supervisor.ctl_factory = supervisorserialrestart.controllerplugin:make_serialrestart_controllerplugin
    

    Which can be achieved using

    node.default['supervisor']['ctlplugins'] = ({
     'serialrestart'=> 'supervisorserialrestart.controllerplugin:make_serialrestart_controllerplugin'
     })

Resources/Providers

supervisor_service

Actions

The default action is the array [:enable, :start]. Actions use the supervisorctl program.

  • :enable - enables the service at boot time
  • :disable - disables the service at boot time
  • :start - starts the service
  • :stop - stops the service
  • :restart - restarts the service
  • :reload - reloads the service

Attribute Parameters

  • :service_name - (Name Attribute), a string, name of the service

The following attributes are used in the program.conf.erb as the values for the corresponding configuration option. See the supervisor documentation for more information about each setting, including applicable defaults.

  • :command - string
  • :process_name - string
  • :numprocs - integer
  • :numprocs_start - integer
  • :priority - integer
  • :autostart - true or false
  • :autorestart - string, symbol, true or false
  • :startsecs - integer
  • :startretries - integer
  • :exitcodes - array
  • :stopsignal - string or symbol
  • :stopwaitsecs - integer
  • :user - string or nil
  • :redirect_stderr - true or false
  • :stdout_logfile - string
  • :stdout_logfile_maxbytes - string
  • :stdout_logfile_backups - string
  • :stdout_capture_maxbytes - string
  • :stdout_events_enabled - true or false
  • :stderr_logfile - string
  • :stderr_logfile_maxbytes - string
  • :stderr_logfile_backups - integer
  • :stderr_capture_maxbytes - string
  • :stderr_events_enabled - true or false
  • :environment- hash
  • :directory- string or nil
  • :umask - string or nil
  • :serverurl - string

Examples

supervisor_service "celery" do
  action :enable
  autostart false
  user "nobody"
end

Recipes

default

Includes the python recipe, installs the supervisor PIP package and sets up supervisor.

License & Authors

Copyright:: 2011-2012, Opscode, Inc <[email protected]>
Copyright:: 2011, Formspring.me

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

supervisor's People

Contributors

alambike avatar alexdeleon avatar backslasher avatar cjerdonek avatar coderanger avatar gilles avatar jsh2134 avatar lehrblogger avatar madjar avatar makmanalp avatar mal avatar paulschwarz avatar pelletiermaxime avatar ranjib avatar rcastane avatar robsonpeixoto avatar sethvargo avatar stevendanna avatar streeter avatar tejaycar avatar toritori0318 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supervisor's Issues

centos supervisord daemon directory

The current method of defining the daemon directory doesn't quite work on centos 6.x:

           Error executing action `start` on resource 'service[supervisor]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of /sbin/service supervisor start ----
           STDOUT: Starting supervisor: [FAILED]
           STDERR: /usr/bin/dirname: extra operand `.pid'
           Try `/usr/bin/dirname --help' for more information.
           /bin/bash: /usr/local/bin/supervisord: No such file or directory
           ---- End output of /sbin/service supervisor start ----
           Ran /sbin/service supervisor start returned 1

Tested on a vagrant with:

[root@default-centos-66 ~]# cat /etc/issue
CentOS release 6.6 (Final)
[root@default-centos-66 ~]# rpm -q python
python-2.6.6-64.el6.x86_64

I've traced this to:

[root@default-centos-66 ~]# grep daemon /etc/init.d/supervisor | grep -v grep
# Manages the supervisor daemon
    daemon "/usr/local/bin/supervisord -c /etc/supervisord.conf "
[root@default-centos-66 ~]# ls /usr/local/bin/supervisord
ls: cannot access /usr/local/bin/supervisord: No such file or directory
[root@default-centos-66 ~]# whereis supervisord
supervisord: /usr/bin/supervisord /etc/supervisord.conf

This is defined in: https://github.com/poise/supervisor/blob/master/templates%2Fdefault%2Frhel%2Fsupervisor.init.erb

supervisor_group no resource or method

I am getting the following error when trying to use supervisor_group

The chef looks like:

supervisor_group "klinche_queue" do
    action :enable
    programs ['klinche_phpresque_default', klinche_phpresque_scheduledworker]
end

supervisor_group "klinche_queue" do
    action :start
end

I don't see any documentation on the supervisor_group is this the correct way?

python_pip resource will always try and update setuptools

Migrated from COOK-3903.

The python_pip resource uses the pip freeze command to find the currently installed version of a python package providers/pip.rb line 111. However, pip freeze does not include the pip and setuptools packages, and as a resource installing either package will always assume the package is not installed and reinstall it, even when the latest version of the package is installed. For instance, the supervisor cookbook will always upgrade setuptools link.

This is hardcoded into the pip source code - https://github.com/pypa/pip/blob/develop/pip/util.py#L350

Two solutions:

  • have pip change the logic
  • have a different strategy into the python_pip provider

Supervisor Service Not Disabling/Deleting

I currently have some supervisor services running on a vagrant server and when I run a supervisor_service disable such as:

supervisor_service "send-email-queue" do
    action :disable
end

The supervisor file is not getting deleted like it should.

Better way to stop supervisor service *if it exists*

For a deploy I have, I'm looking to shut down a supervisord during the nodes upgrade because there are multiple nodes of this specific type. So I have HA and can do a "rolling upgrade" to avoid the currently upgrading server from serving requests with partially updated state.

The problem is that for a fully idempotent upgrade/install, I cannot assume that the service has even been created yet. So during the stop, it will blow up if the service doesn't exist.

Now, I can catch that exception and roll on, but the problem is that the exception is not typed, so I cannot be confident that the known exception is even what occurred as I allow it to happen while trying a stop. So...

  • Should there be a more specific exception type for this?
  • Is there a better way to try a stop where the service may not yet exist and am I just doing it wrong?

Server does not reload after config is modified

I tried fixing this by subscribing the service resources to the restart action when the config changes, but it didn't appear to do the job. supervisorctl reload did, but hopefully there's a better way.

eventlistener attribute is not recognized by chefspec

Writing unit tests for event listeners seems to be broken. chefspec doesn't seem to recognize the eventlistener attribute.

I am setting up some supervisor event listeners like so in a recipe sulphite_cookbook::sulphite:

supervisor_service 'sulphite' do
    command "sulphite -s #{node['sulphite']['graphite_server']} -p #{node['sulphite']['graphite_port']} -P #{node['sulphite']['graphite_prefix']}" 
    eventlistener true
    eventlistener_events ['PROCESS_STATE']

    autostart true

    stdout_logfile "/var/log/supervisor/sulphite.log"
    stderr_logfile "/var/log/supervisor/sulphite.log"
end

My test:

describe 'sulphite_cookbook::default' do
    let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }

    it 'includes the sulphite recipe' do
        expect(chef_run).to include_recipe('sulphite_cookbook::sulphite')
    end
end

When I run the tests, I get this error

================================================================================
Recipe Compile Error in /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `eventlistener' for Chef::Resource::SupervisorService

Cookbook Trace:
---------------
  /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/sulphite.rb:7:in `block in from_file'
  /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/sulphite.rb:5:in `from_file'
  /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/default.rb:11:in `from_file'

Relevant File Content:
----------------------
/var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/sulphite.rb:

  1:  # Install sulphite supervisord eventlistener
  2:
  3:  python_pip 'git+https://github.com/jib/sulphite.git@20ee77bc7e965d3c65a3d53dcc1dbf98e4ef06a8'
  4:
  5:  supervisor_service 'sulphite' do
  6:      command "sulphite -s #{node['sulphite']['graphite_server']} -p #{node['sulphite']['graphite_port']} -P #{node['sulphite']['graphite_prefix']}"
  7>>     eventlistener true
  8:      eventlistener_events ['PROCESS_STATE']
  9:
 10:      autostart true
 11:
 12:      stdout_logfile "/var/log/supervisor/sulphite.log"
 13:      stderr_logfile "/var/log/supervisor/sulphite.log"
 14:  end 15:

F

Failures:

  1) sulphite_cookbook::default includes the sulphite recipe
     Failure/Error: let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
     NoMethodError:
       undefined method `eventlistener' for Chef::Resource::SupervisorService
     # /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/sulphite.rb:7:in `block in from_file'
     # /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/sulphite.rb:5:in `from_file'
     # /var/folders/r1/wbq1kr154kq35n2rtsj8xmc80000gn/T/d20140719-69873-1j5yvlm/cookbooks/sulphite_cookbook/recipes/default.rb:11:in `from_file'
     # ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>'
     # ./spec/default_spec.rb:7:in `block (2 levels) in <top (required)>'

Finished in 0.20475 seconds (files took 2.47 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/default_spec.rb:6 # sulphite_cookbook::default includes the sulphite recipe

Are the eventlistener and eventlistener_events attributes handled differently than the other attributes. They don't seem to be documented. I am using v0.4.10 of the supervisor cookbook.

Compatibility with chef13

Supervisor cookbooks need to be updated for -

  1. Change python to poise python as python cookbook is deprecated.
  2. Chef 13+ Compatibility

Depends on deprecated cookbook python

When using poise-python cookbook and setting up a venv with python 3 the installation of supervisor fails.

==> default: [2016-01-04T22:12:28+00:00] ERROR: python_pip[supervisor] (supervisor::default line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
==> default: ---- Begin output of pip install  --upgrade supervisor ----
==> default: STDOUT: Collecting supervisor
==> default:   Using cached supervisor-3.2.0.tar.gz
==> default:     Complete output from command python setup.py egg_info:
==> default:     Supervisor requires Python 2.4 or later but does not work on any version of Python 3.  You are using version 3.4.3 (default, Oct 14 2015, 20:28:29)
==> default:     [GCC 4.8.4].  Please install using a supported version.
==> default:     
==> default:     ----------------------------------------
==> default: STDERR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-k57arkip/supervisor

It appears to be depending on the previous cookbook for python and supervisor cookbook offers no way to install from source with the master branch now supporting python 3

supervisor_service is not creating /etc/supervisor.d/XXX.conf

Migrated from COOK-3392.

After upgrading the recipe from 0.4.4, the service file is not created. Reverting to 0.4.2 works.

supervisor_service("spider") do
  action [:enable, :start]
  updated true
  retries 0
  retry_delay 2
  cookbook_name "spider"
  recipe_name "default"
  user "spider"
  directory "/var/lib/spider"
  numprocs_start 1
  environment {:HOME=>"/var/lib/spider", :USER=>"spider", :SENTRY_DSN=>"https://bcc9163c83ce42a99ca79d7c4b5628ea:[email protected]/2", :GHOSTERY_BUGS=>"/var/lib/spider/.ghostery.bugs", :SCRAPY_PROJECT=>"tarsier", :SCRAPY_SETTINGS_MODULE=>"tarsier.settings", :SCRAPY_AMQP_URL=>"amqp://spider:[email protected]/nitidum", :SCRAPY_HYPERTABLE_HOST=>"localhost", :SCRAPY_MONGO_HOST=>"localhost", :SCRAPY_HTTPCACHE_ENABLED=>"0"}
  command "/usr/share/spider/bin/scrapy distributed --id %(process_num)d"
  process_name "%(process_num)d"
  stopwaitsecs 180
  service_name "spider"
end





================================================================================
Error executing action `start` on resource 'supervisor_service[spider]'
================================================================================


RuntimeError
------------
Supervisor service spider cannot be started because it does not exist


Cookbook Trace:
---------------
/var/chef/cache/cookbooks/supervisor/providers/service.rb:40:in `block in class_from_file'


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/spider/recipes/default.rb

111: supervisor_service "spider" do
112:   action [:enable, :start]
113:   autostart false
114:   autorestart false
115:   user node[:spider][:user]
116:   directory node[:spider][:home]
117:   numprocs_start 1
118:   environment({
119:           :HOME => node[:spider][:home],
120:           :USER => node[:spider][:user],
121:
122:           :SENTRY_DSN => node[:spider][:sentry_url],
123:           :GHOSTERY_BUGS => node[:spider][:ghostery_cache],
124:
125:           :SCRAPY_PROJECT => "tarsier",
126:           :SCRAPY_SETTINGS_MODULE => "tarsier.settings",
127:
128:           :SCRAPY_AMQP_URL => rabbitmq_server,
129:           :SCRAPY_HYPERTABLE_HOST => node[:spider][:hypertable_host],
130:           :SCRAPY_MONGO_HOST => node[:spider][:mongo_host],
131:           :SCRAPY_HTTPCACHE_ENABLED => node[:spider][:crawler_cache],
132:
133:           #:SCRAPY_MODE => "development",
134:         })
135:   command "#{node[:spider][:command]} distributed --id %(process_num)d"
136:   process_name "%(process_num)d"
137:   stopwaitsecs node[:spider][:crawler_stopwaitsecs]
138: end
139:



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/spider/recipes/default.rb:111:in `from_file'

supervisor_service("spider") do
  action [:enable, :start]
  updated true
  retries 0
  retry_delay 2
  cookbook_name "spider"
  recipe_name "default"
  user "spider"
  directory "/var/lib/spider"
  numprocs_start 1
  environment {XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
  command "/usr/share/spider/bin/scrapy distributed --id %(process_num)d"
  process_name "%(process_num)d"
  stopwaitsecs 180
  service_name "spider"
end



[2013-07-26T04:40:15+10:00] INFO: Running queued delayed notifications before re-raising exception
[2013-07-26T04:40:15+10:00] DEBUG: Re-raising exception: RuntimeError - supervisor_service[spider] (spider::default line 111) had an error: RuntimeError: Supervisor service spider cannot be started because it does not exist
/var/chef/cache/cookbooks/supervisor/providers/service.rb:40:in `block in class_from_file'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider/lwrp_base.rb:138:in `instance_eval'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider/lwrp_base.rb:138:in `block in action'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider.rb:118:in `run_action'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:625:in `run_action'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:49:in `run_action'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `block (2 levels) in converge'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `each'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `block in converge'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:96:in `execute_each_resource'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:80:in `converge'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:429:in `converge'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:494:in `do_run'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:199:in `block in run'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `fork'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `run'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:183:in `run_chef_client'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:302:in `block in run_application'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `loop'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `run_application'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:66:in `run'
  /var/lib/gems/1.9.1/gems/chef-11.6.0/bin/chef-client:26:in `<top (required)>'
  /usr/local/bin/chef-client:23:in `load'
  /usr/local/bin/chef-client:23:in `<main>'
[2013-07-26T04:40:15+10:00] ERROR: Running exception handlers
[2013-07-26T04:40:15+10:00] ERROR: Exception handlers complete
[2013-07-26T04:40:15+10:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-07-26T04:40:15+10:00] DEBUG: RuntimeError: supervisor_service[spider] (spider::default line 111) had an error: RuntimeError: Supervisor service spider cannot be started because it does not exist
/var/chef/cache/cookbooks/supervisor/providers/service.rb:40:in `block in class_from_file'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider/lwrp_base.rb:138:in `instance_eval'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider/lwrp_base.rb:138:in `block in action'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider.rb:118:in `run_action'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:625:in `run_action'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:49:in `run_action'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `each'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:81:in `block in converge'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:80:in `converge'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:429:in `converge'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:494:in `do_run'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:199:in `block in run'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `fork'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `run'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:183:in `run_chef_client'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:302:in `block in run_application'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `loop'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/client.rb:294:in `run_application'
/var/lib/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:66:in `run'
/var/lib/gems/1.9.1/gems/chef-11.6.0/bin/chef-client:26:in `<top (required)>'
/usr/local/bin/chef-client:23:in `load'
/usr/local/bin/chef-client:23:in `<main>'
Chef Client failed. 9 resources updated
[2013-07-26T04:40:15+10:00] DEBUG: Server doesn't support resource history, skipping resource report.
[2013-07-26T04:40:15+10:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Make inclusion of python recipe optional

This is a little bit convoluted, but:

  • supervisor includes the python recipe by default
  • which allows installation of python by OS packages
  • without the ability to specify alternate packages, your system python is stuck at 2.6 on rhel (for example)
  • this issue [1] over on the python cookbook would solve that
  • until then, the inclusion of recipe[python] here means that system python is installed where alternate packages may have already been installed (due to local work-arounds to that issue)
  • this is likely compatible, but also unnecessary
  • if [1] is merged, this issue can be closed with nofix. otherwise, I'd want to make a pull-request here making that include_recipe statement optional (e.g., via an attribute).

[1] poise/python#90

Service template permissions (mode)

Would you be receptive to a PR that exposes the service template file permissions (mode) to the resource provider? I have some secrets in the files that I do not want world readable. Sure I could just run a resource immediately after to change the permissions but it would be less typing to set the mode per supervisor_service resource.

https://github.com/poise/supervisor/blob/master/providers/service.rb#L97

Thanks for the great cookbook BTW. I've used it many many times!

supervisor 3.1.0 breaks "service" provider

the response to supervisorctl status service_name has changed from supervisor 3.0 to 3.1.0.

3.0:

$ sudo supervisorctl status service_name
No such process service_name

3.1.0:

$ sudo supervisorctl status service_name
pypi: ERROR (no such process)

in "get_current_state", the new output breaks the conditional:

  if stdout.include? "No such process #{service_name}"
    "UNAVAILABLE"

AWS OpsWorks install fails

Hi,

When adding supervisor as a recipe, the installation fails (on aws AMI 2015.03).

The node["python"]["prefix_dir"] is by default unproperly set to /usr instead of /usr/local

How to set attributes

Hi. I have a question regarding the cookbook.
I try to configure supervisor config file and I need to pass following attributes:
[program:name]
command=
directory=
autostart=
user=
stdout_logfile=
stderr_logfile=

I would like to use chef role for that and I have as following:

default_attributes(
    :supervisor_service => {
        "daemon_options" => {
            "service_name" => "kafka-broker-4555",
            "autostart"    => true,
            "user"         => "kafka"
        }
    }
)

It doesn't work so the above is incorrect.

supervisor_service runs the template resource twice

After the template and execute resources in service.rb, there is this block of code:

  t.run_action(:create)
  if t.updated?
    e.run_action(:run)
  end

This results in the template resource being run twice (formatting modified for readability, chef doesn't output correctly):

  * supervisor_service[program] action enable
  * template[/etc/supervisor.d/program.conf] action create (up to date)
    - Enabling supervisor_service[program]
  * execute[supervisorctl update] action nothing (skipped due to action :nothing)
  * template[/etc/supervisor.d/program.conf] action create (up to date)

init.d script misconfiguration

init.d script should suid properly to the root user.

Looking at the init script for debian/ubuntu the problem is obvious. At lines:
https://github.com/poise/supervisor/blob/master/templates/default/debian/supervisor.init.erb#L95
https://github.com/poise/supervisor/blob/master/templates/default/debian/supervisor.init.erb#L146

You must add -u root -c root -g root, or set it to the proper user.

In my case, when running chef on the node, I get variables propagated from the chef run and it ends up setting $HOME to /home/chef and more.

supervisor_service triggers an enable on every run

version 0.4.11:

supervisor_service "gunicorn" do
end

causes this:

- Enabling supervisor_service[gunicorn]

on every run, even in this base example where nothing has changed and the service is already enabled.

service does not restart

git "some_repo" do
  notifies :restart, "supervisor_service[for_repo]"
end

It does not seem to restart the service:

  * supervisor_service[for_repo] action restart (up to date)
Chef Client finished, 4 resources updated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.