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