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

Windows service in Paused state cannot be managed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • PUP 4.6.2, PUP 4.10.4
    • PUP 6.0.3
    • Windows
    • TEST_TARGET=windows2008r2-64a
      SUITE_VERSION=1.6.2.135.g8a48f21
      SUITE_COMMIT=8a48f210f6901be0edba16eb49c1bfbfb07d338b

    • Platform OS
    • Platform OS Kanban
    • Customer Feedback
    • Major
    • 3 - 25-50% of Customers
    • 4 - Major
    • 5 - $$$$$$
    • Hide
      Because some of our windows agents(ex. PXP) use NSSM this bug prevents us from restarting those services via puppet code if they fail to start in the first place.

      This bug combined with the fact that PXP is what runs tasks requires customers to use puppet code with an exec(rather than service resources) or to manually intervene to get it running again
      Show
      Because some of our windows agents(ex. PXP) use NSSM this bug prevents us from restarting those services via puppet code if they fail to start in the first place. This bug combined with the fact that PXP is what runs tasks requires customers to use puppet code with an exec(rather than service resources) or to manually intervene to get it running again
    • 35233,36103
    • 2
    • Bug Fix
    • Puppet can now set ensure = running/stopped on paused Windows services.

    Description

      When a service is in the Paused state; it's 'ensure' property cannot be managed by Puppet

      Note that for our own services that use nssm; nssm has a characteristic that it uses the "Paused" service state for a service that has reached a fault state (see https://nssm.cc/usage )

      To reproduce:

      • Install puppet-agent
      • Ensure pxp-agent service is stopped in services.msc
      • Ensure the ProgramData/PuppetLabs/pxp-agent/etc/pxp-agent.conf file is renamed or deleted
      • Run puppet resource service pxp-agent ensure=running

      The service will now be in the paused state.
      Attempting puppet resource service pxp-agent ensure=stopped will echo back ensure=stopped , but services.msc will show the service as still paused.
      Attempting puppet resource service pxp-agent ensure=running will return an error:

      C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Puppet>puppet resource serv
      ice pxp-agent ensure=running
      Error: Cannot start pxp-agent, error was: Execution of 'C:/Windows/system32/net.
      exe start pxp-agent' returned 2: The requested service has already been started.
       
       
      More help is available by typing NET HELPMSG 2182.
      Wrapped exception:
      Execution of 'C:/Windows/system32/net.exe start pxp-agent' returned 2: The reque
      sted service has already been started.
       
      More help is available by typing NET HELPMSG 2182.
      Error: /Service[pxp-agent]/ensure: change from stopped to running failed: Cannot
       start pxp-agent, error was: Execution of 'C:/Windows/system32/net.exe start pxp
      -agent' returned 2: The requested service has already been started.
       
      More help is available by typing NET HELPMSG 2182.

      Outside of Puppet, the service can be stopped by simply using the Stop option in services.msc

      Expected behaviour:

      • The "Paused" state should be understood by Puppet for a Windows service resource. Or at least; Puppet should actually stop a service in the "Paused" state when ensure=stopped is applied.

      Attachments

        Issue Links

          Activity

            People

              enis.inan Enis Inan
              james.stocks James Stocks
              Votes:
              3 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support