restart_service method added
This commit is contained in:
parent
64a7f9dcf7
commit
6fe82e7b32
20
lib.cf
20
lib.cf
|
@ -103,15 +103,31 @@ bundle agent wmde_service(service_name,start_cond, restart_cond)
|
||||||
services:
|
services:
|
||||||
"$(start_cond)"::
|
"$(start_cond)"::
|
||||||
"$(service_name)"
|
"$(service_name)"
|
||||||
service_policy => "start";
|
service_policy => "start",
|
||||||
|
handle => "$(handle)_service_started";
|
||||||
|
|
||||||
"$(restart_cond)"::
|
"$(restart_cond)"::
|
||||||
"$(service_name)"
|
"$(service_name)"
|
||||||
service_policy => "restart";
|
service_policy => "restart",
|
||||||
|
handle => "$(handle)_service_restarted";
|
||||||
reports:
|
reports:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bundle agent wmde_restart_service(service_name, id)
|
||||||
|
{
|
||||||
|
commands:
|
||||||
|
debian::
|
||||||
|
"/bin/sh -c "
|
||||||
|
args => "'/bin/echo $(id) > /dev/null && /usr/bin/systemctl restart $(service_name)'";
|
||||||
|
freebsd::
|
||||||
|
"/bin/sh -c "
|
||||||
|
args => "'/bin/echo $(id) > /dev/null && /usr/sbin/service onerestart $(service_name)'";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
body contain wmde_cmd_useshell
|
body contain wmde_cmd_useshell
|
||||||
{
|
{
|
||||||
useshell=>"useshell";
|
useshell=>"useshell";
|
||||||
|
|
Loading…
Reference in New Issue