@@ -58,7 +58,10 @@ class RunitService < Chef::Resource::Service
58
58
property :check_script_template_name , String , default : lazy { service_name }
59
59
property :finish_script_template_name , String , default : lazy { service_name }
60
60
property :control_template_names , Hash , default : lazy { set_control_template_names }
61
- property :status_command , String , default : lazy { "#{ sv_bin } status #{ service_dir } " }
61
+ property :status_command , String , default : 'status'
62
+ property :start_command , String , default : 'start'
63
+ property :stop_command , String , default : 'stop'
64
+ property :restart_command , String , default : 'restart'
62
65
property :sv_templates , [ TrueClass , FalseClass ] , default : true
63
66
property :sv_timeout , Integer
64
67
property :sv_verbose , [ TrueClass , FalseClass ] , default : false
@@ -97,10 +100,10 @@ def after_created
97
100
find_resource ( :service , new_resource . name ) do # creates if it does not exist
98
101
provider Chef ::Provider ::Service ::Simple
99
102
supports new_resource . supports
100
- start_command "#{ new_resource . sv_bin } start #{ service_dir_name } "
101
- stop_command "#{ new_resource . sv_bin } stop #{ service_dir_name } "
102
- restart_command "#{ new_resource . sv_bin } restart #{ service_dir_name } "
103
- status_command "#{ new_resource . sv_bin } status #{ service_dir_name } "
103
+ start_command "#{ new_resource . sv_bin } #{ new_resource . start_command } #{ service_dir_name } "
104
+ stop_command "#{ new_resource . sv_bin } #{ new_resource . stop_command } #{ service_dir_name } "
105
+ restart_command "#{ new_resource . sv_bin } #{ new_resource . restart_command } #{ service_dir_name } "
106
+ status_command "#{ new_resource . sv_bin } #{ new_resource . status_command } #{ service_dir_name } "
104
107
action :nothing
105
108
end
106
109
end
0 commit comments