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

service status field behaves exactly other way than documentation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 2.7.23
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      The documentation states at http://docs.puppetlabs.com/references/latest/type.html#service-attribute-status

      status
      Specify a status command manually. This command must return 0 if the service is running and a nonzero value otherwise.

      But in fact it is exactly the other way round.

      For a non running service to be started the status must return 0.
      If status returns 1 nothing happens.

      So this snipped worked for me in the end.

      service { 'my-service':
        ensure     => running,
          hasstatus  => false,
          status     => "test $(ps fax | grep my-service | wc -l) -eq 0"
      }
      

        Attachments

          Activity

            People

            • Assignee:
              kylo Kylo Ginsberg
              Reporter:
              de David Edler
              QA Contact:
              Erik Dasher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support