Commit 90b87466 authored by jtimberman's avatar jtimberman
Browse files

Fixes #88, use imeyer's packagecloud repo for RHEL

- Change the "use_package_from_yum" attribute to "prefer_local_yum" to
clarify intent. The default value will be set to the old attribute to
attempt to preserve compatibility and default to false otherwise
- Update the metadata and Cheffile to remove cookbooks that are not
- Remove the runit tar.gz
- Update the readme
- Remove build-from-source portion of readme, and prefer packagecloud,
as it's the same package anyway
parent 1d040332
......@@ -2,8 +2,6 @@
site ''
cookbook 'apt'
cookbook 'yum'
cookbook 'runit', path: '.'
cookbook 'runit_test', path: './test/cookbooks/runit_test'
cookbook 'runit-other_test', path: './test/cookbooks/runit-other_test'
apt (2.6.0)
chef_handler (1.1.6)
minitest-handler (1.3.2)
chef_handler (>= 0.0.0)
yum (3.5.1)
build-essential (2.1.3)
yum-epel (0.5.3)
yum (~> 3.0)
packagecloud (0.0.17)
remote: .
runit (1.5.11)
build-essential (>= 0.0.0)
yum (~> 3.0)
yum-epel (>= 0.0.0)
runit (1.5.18)
packagecloud (>= 0.0.0)
remote: ./test/cookbooks/runit-other_test
......@@ -33,10 +23,8 @@ PATH
runit_test (1.0.0)
apt (>= 0)
minitest-handler (>= 0)
runit (>= 0)
runit-other_test (>= 0)
runit_test (>= 0)
yum (>= 0)
......@@ -16,6 +16,8 @@ Requirements
- Gentoo
### Cookbooks
- packagecloud (for RHEL)
......@@ -32,23 +34,19 @@ See `attributes/default.rb` for defaults generated per platform.
### Optional Attributes for RHEL systems
- `node['runit']['use_package_from_yum']` - If `true`, attempts to install
runit without building an RPM first. This is for users who already have
the package in their own Yum repository.
- `node['runit']['prefer_local_yum']` - If `true`, assumes that a `runit` package is available on an already configured local yum repository. By default, the recipe installs the `runit` package from a Package Cloud repository (see below). This is set to the value of `node['runit']['use_package_from_yum']` for backwards compatibility, but otherwise defaults to `false`.
### default
The default recipe installs runit and starts `runsvdir` to supervise the services in runit's service directory (e.g., `/etc/service`).
On RHEL family systems, it will build the runit RPM using [Ian Meyer's runit RPM SPEC]( unless the attribute `node['runit']['use_package_from_yum']` is set to `true`. In which case it will try and install runit through the normal package installation mechanism.
On RHEL-family systems, it will install the runit RPM using [Ian Meyer's Package Cloud repository]( for runit. This replaces the previous functionality where the RPM was build using his [runit RPM SPEC]( However, if the attribute `node['runit']['prefer_local_yum']` is set to `true`, the packagecloud repository creation will be skipped and it is assumed that a `runit` package is available on an otherwise configured (outside this cookbook) local repository.
On Debian family systems, the runit packages are maintained by the runit author, Gerrit Pape, and the recipe will use that for installation.
On Gentoo, the runit ebuild package is installed.
This cookbook has a resource, `runit_service`, for managing services under runit. This service subclasses the Chef `service` resource.
......@@ -43,7 +43,7 @@ when 'rhel'
default['runit']['sv_dir'] = '/etc/sv'
default['runit']['lsb_init_dir'] = '/etc/init.d'
default['runit']['executable'] = '/sbin/runit'
default['runit']['use_package_from_yum'] = false
default['runit']['prefer_local_yum'] = node['runit']['use_package_from_yum'] || false
default['runit']['start'] = '/etc/init.d/runit-start start'
default['runit']['stop'] = '/etc/init.d/runit-start stop'
default['runit']['reload'] = '/etc/init.d/runit-start reload'
......@@ -12,6 +12,4 @@ recipe 'runit', 'Installs and configures runit'
supports os
depends 'build-essential'
depends 'yum', '~> 3.0'
depends 'yum-epel'
depends 'packagecloud'
......@@ -39,49 +39,8 @@ end
case node['platform_family']
when 'rhel'
if node['runit']['use_package_from_yum']
package 'runit'
include_recipe 'build-essential'
# `rpmdevtools` is in EPEL repo in EL <= 5
include_recipe 'yum-epel' if node['platform_version'].to_i == 5
packages = %w{rpm-build rpmdevtools tar gzip}
packages.each do |p|
package p
if node['platform_version'].to_i >= 6
package 'glibc-static'
package 'buildsys-macros'
# This is the rpm spec and associated files to build a package of
# runit from source; the package will be installed.
cookbook_file "#{Chef::Config[:file_cache_path]}/runit-2.1.1.tar.gz" do
source 'runit-2.1.1.tar.gz'
not_if { runit_installed? }
notifies :run, 'bash[rhel_build_install]', :immediately
# This bash resource does the rpm install because we need to
# dynamically detect where the rpm output directory is from the
# rpm config directive '%{_rpmdir}'
bash 'rhel_build_install' do
user 'root'
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar xzf runit-2.1.1.tar.gz
cd runit-2.1.1
rpm_root_dir=`rpm --eval '%{_rpmdir}'`
rpm -ivh "${rpm_root_dir}/runit-2.1.1.rpm"
action :run
not_if { runit_installed? }
packagecloud_repo 'imeyer/runit' unless node['runit']['prefer_local_yum']
package 'runit'
when 'debian', 'gentoo'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment