Skip to content

Commit f8dfae4

Browse files
committed
Adding testing cookbook for CHEF-56, minor fix to service init command
1 parent 90557e7 commit f8dfae4

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

chef/lib/chef/provider/service/init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Init < Chef::Provider::Service
2626

2727
def initialize(node, new_resource)
2828
super(node, new_resource)
29-
@init_command ||= "/etc/init.d/#{@new_resource.service_name}"
29+
@init_command = "/etc/init.d/#{@new_resource.service_name}"
3030
end
3131

3232
def load_current_resource

chef/lib/chef/provider/service/redhat.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Redhat < Chef::Provider::Service::Init
2727

2828
def initialize(node, new_resource)
2929
super(node, new_resource)
30-
@init_command ||= "/sbin/service #{@new_resource.service_name}"
30+
@init_command = "/sbin/service #{@new_resource.service_name}"
3131
end
3232

3333
def load_current_resource
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Cookbook Name:: CHEF-56
3+
# Recipe:: default
4+
#
5+
# Copyright 2009, Example Com
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
service "vncserver" do
21+
supports :status => true, :reload => true
22+
action :enable
23+
end
24+
25+
service "vncserver" do
26+
action :start
27+
end
28+
29+
service "vncserver" do
30+
action :restart
31+
end
32+
33+
service "vncserver" do
34+
action :stop
35+
end
36+
37+
service "vncserver" do
38+
action :disable
39+
end

0 commit comments

Comments
 (0)