From 92ee945173ed2389b5fe4069fd9b403ba7703397 Mon Sep 17 00:00:00 2001 From: "Balasankar \"Balu\" C" Date: Wed, 27 Feb 2019 00:13:40 +0530 Subject: [PATCH] Update helper methods for servie commands Signed-off-by: Balasankar "Balu" C --- libraries/helpers.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 021d818..c743fd4 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -71,7 +71,7 @@ def runit_send_signal(signal, friendly_name = nil) end def running? - cmd = safe_sv_shellout("#{sv_args}status #{service_dir_name}", returns: [0, 100]) + cmd = safe_sv_shellout("#{sv_args}#{new_resource.status_command} #{service_dir_name}", returns: [0, 100]) !cmd.error? && cmd.stdout =~ /^run:/ end @@ -153,15 +153,15 @@ def disable_service end def start_service - safe_sv_shellout!("#{sv_args}start #{service_dir_name}") + safe_sv_shellout!("#{sv_args}#{new_resource.start_command} #{service_dir_name}") end def stop_service - safe_sv_shellout!("#{sv_args}stop #{service_dir_name}") + safe_sv_shellout!("#{sv_args}#{new_resource.stop_command} #{service_dir_name}") end def restart_service - safe_sv_shellout!("#{sv_args}restart #{service_dir_name}") + safe_sv_shellout!("#{sv_args}#{new_resource.restart_command} #{service_dir_name}") end def restart_log_service