Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5353

Statically-enabled systemd service is treated like SysV init scripts - enabled each run.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.2.1, PUP 4.2.2
    • Fix Version/s: PUP 4.5.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2016-04-20
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Previously, the puppet service resource attempted to enable or disable static services on systemd. This resulted in erroneous change notifications.
      This fix corrects the problem. Changing the {{enable}} parameter for a static service no longer triggers a change and a {{debug}} message is logged.
      Show
      Previously, the puppet service resource attempted to enable or disable static services on systemd. This resulted in erroneous change notifications. This fix corrects the problem. Changing the {{enable}} parameter for a static service no longer triggers a change and a {{debug}} message is logged.

      Description

      Overview

      Statically-enabled systemd service is treated like SysV init scripts - enabled each run. One of the example is 'dbus' / 'messagebus' service which is not using SysV init script.

      # systemctl is-enabled dbus.service
      static
      

      # ls /usr/lib/systemd/system/multi-user.target.wants/|grep dbus 
      dbus.service
      

      This is the manifest that is used in the test:

      package { 'dbus': ensure => installed, } 
      $dbus_service = $::operatingsystemmajrelease ? { 
      '5' => 'messagebus', 
      '6' => 'messagebus', 
      '7' => 'dbus', 
      } 
      service { 'messagebus': 
      ensure => running, 
      name => $dbus_service, 
      enable => true, 
      require => Package['dbus'], 
      }
      

      Every puppet run changes enabled from 'false' to 'true':

      [root@pe-centos7-master ~]# puppet apply /tmp/test.pp 
      Notice: Compiled catalog for pe-centos7-master in environment production in 0.93 seconds
      Notice: /Stage[main]/Main/Service[messagebus]/enable: enable changed 'false' to 'true'
      Notice: Applied catalog in 0.30 seconds
      

      Workaround

      Setting provider => redhat on services that use init scripts instead of systemd units should work around the issue.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  john.duarte John Duarte
                  Reporter:
                  ali Ali Tukimin
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  10 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: