Alexandros Kosiaris has submitted this change and it was merged.

Change subject: sysfs: puppet always restarted the sysfsutils service
......................................................................


sysfs: puppet always restarted the sysfsutils service

Whenever using sysf::parameters() or sysfs::conffile() puppet ends up
attempting to start the service over and over again:

    Debug: Executing '/etc/init.d/sysfsutils status'
    Debug: Executing '/etc/init.d/sysfsutils start'
    Notice: /Stage[main]/Sysfs/Service[sysfsutils]/ensure: ensure
            changed 'stopped' to 'running'

The reason is the sysfsutils service does not have any permanent
process, it merely applies settings based on configuration files.
Additionally the init script lacks a status command.

sysfs::conffile() does notify the 'sysfsutils' service which is
sufficient to have it restart.
sysfs::parameters() relies on sysfs::conffile()

Service lacks a status command, and it is meaningless. Override it with
/bin/true to skip it entirely.
Have the service start on boot (enabled).
Optimize restart when notified by setting 'hasrestart'. Puppet will then
invokes 'restart' instead of 'stop' and then 'start'.

Change-Id: I8006166ba0e31f666d2790af9afc4d556ae4b4fd
---
M modules/sysfs/manifests/init.pp
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Hashar: Looks good to me, but someone else must approve
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/modules/sysfs/manifests/init.pp b/modules/sysfs/manifests/init.pp
index b812b33..877534a 100644
--- a/modules/sysfs/manifests/init.pp
+++ b/modules/sysfs/manifests/init.pp
@@ -20,6 +20,16 @@
     }
 
     service { 'sysfsutils':
-        ensure => running,
+        ensure     => running,
+        # Does not have any permanent process, so prevent puppet from
+        # attempting to restart a service which is not meant to be running.
+        # sysfs::conffile() notify the service to trigger the restart whenever
+        # configuration files change.
+        hasstatus  => false,
+        status     => '/bin/true',
+        # Have it running on boot
+        enable     => true,
+        # Quicker restart
+        hasrestart => true,
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/266684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8006166ba0e31f666d2790af9afc4d556ae4b4fd
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to