From ebef18c9ee214bb0ebb0496bdd8aae5cd6d05514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Gonz=C3=A1lez=20Serrano?= Date: Mon, 6 Jul 2015 22:40:54 +0200 Subject: [PATCH] Fix #6. Systemd file paths differs on Debian and Redhat/Centos --- manifests/check/service.pp | 2 +- manifests/params.pp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/check/service.pp b/manifests/check/service.pp index 22d5f2c..35a131e 100644 --- a/manifests/check/service.pp +++ b/manifests/check/service.pp @@ -40,7 +40,7 @@ $initd = undef, $sysv_file = "/etc/init.d/${name}", $upstart_file = "/etc/init/${name}.conf", - $systemd_file = "/usr/lib/systemd/system/${name}.service", + $systemd_file = "${monit::systemd_prefix}${name}${monit::systemd_suffix}", # Params for process type. $pidfile = undef, diff --git a/manifests/params.pp b/manifests/params.pp index fd3fd26..6e79a37 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,7 +27,9 @@ $init_system = 'sysv' } else { - $init_system = 'systemd' + $init_system = 'systemd' + $systemd_prefix = '/etc/init.d/' + $systemd_suffix = '' } } 'Ubuntu': { @@ -51,7 +53,9 @@ $init_system = 'sysv' } else { - $init_system = 'systemd' + $init_system = 'systemd' + $systemd_prefix = '/usr/lib/systemd/system/' + $systemd_suffix = '.service' } } default: {