From 89882ae849423016bd454e1882185b7af7b8d1f4 Mon Sep 17 00:00:00 2001 From: Swann Croiset Date: Mon, 2 May 2016 17:41:14 +0200 Subject: [PATCH] Remove the init script shipped by the heka package This prevents to restart all collectors by side effect when '/etc/init.d/heka stop' is run. Change-Id: I4f743e765e5895f3c97505a166140bcd80f7ce34 Partial-bug: #1570850 --- .../puppet/modules/heka/manifests/init.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deployment_scripts/puppet/modules/heka/manifests/init.pp b/deployment_scripts/puppet/modules/heka/manifests/init.pp index efd40502a..cb2724efc 100644 --- a/deployment_scripts/puppet/modules/heka/manifests/init.pp +++ b/deployment_scripts/puppet/modules/heka/manifests/init.pp @@ -152,7 +152,9 @@ define heka ( if $::osfamily == 'Debian' { # Starting from Heka 0.10.0, the Debian package provides a SysV init - # script so we need to stop the service and disable it. + # script so we need to stop the service and remove the init script. + # If this script isn't removed, the user may accidentally stop *all* the + # running hekad processes by invoking '/etc/init.d/heka stop'. exec { 'stop_heka_daemon': command => '/etc/init.d/heka stop', onlyif => '/usr/bin/test -f /etc/init.d/heka', @@ -163,6 +165,12 @@ define heka ( exec { 'disable_heka_daemon': command => '/usr/sbin/update-rc.d heka disable', refreshonly => true, + notify => Exec['remove_heka_service'], + } + + exec { 'remove_heka_service': + command => '/bin/rm -f /etc/init.d/heka', + refreshonly => true, } } }