Skip to content

Commit

Permalink
cook-171, cook-174, value_for_platform, inittab
Browse files Browse the repository at this point in the history
cook-174, use value_for_platform logic to notify with
nothing on debian 5.

cook-171, remove inittab, the runit package on ubuntu does
what it should to control SV.
  • Loading branch information
jtimberman committed Aug 29, 2009
1 parent dc8f376 commit 1998081
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions runit/recipes/default.rb
Expand Up @@ -2,14 +2,14 @@
# Cookbook Name:: runit
# Recipe:: default
#
# Copyright 2008, OpsCode, Inc.
# Copyright 2008, Opscode, Inc.
#
# 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.
Expand All @@ -20,29 +20,27 @@
case node[:platform]
when "debian","ubuntu"
execute "start-runsvdir" do
case node[:platform]
when "debian"
command "runsvdir-start"
else
command "start runsvdir"
end
command value_for_platform(
"debian" => { "default" => "runsvdir-start" },
"ubuntu" => { "default" => "start runsvdir" }
)
action :nothing
end

package "runit" do
action :install
notifies :run, resources(:execute => "start-runsvdir")
notifies value_for_platform(
"debian" => { "4.0" => :run, "default" => :nothing },
"ubuntu" => { "default" => :run }
), resources(:execute => "start-runsvdir")
end

if node[:platform_version].to_f <= 8.04 && node[:platform] =~ /ubuntu/i
if node[:platform_version] <= "8.04" && node[:platform] =~ /ubuntu/i
remote_file "/etc/event.d/runsvdir" do
source "runsvdir"
mode 0644
notifies :run, resources(:execute => "start-runsvdir")
end

file "/etc/inittab" do
action :touch
only_if do File.directory?("/etc/event.d") end
end
end
end

0 comments on commit 1998081

Please sign in to comment.