saltstack / saltstack/salt

[FEATURE REQUEST] Allow starting not enabled services on Windows minions

Open
#59,518 5 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Confirmed effort-medium Execution-Module Feature severity-medium Windows
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Hi,

I have a case where service MUST be started manually and 'enable: True' is not a solution.

As a temporary workaround I used modules:

{# Waiting for investigation. Stopped working as of update to salt version 3002.2 on Windows hosts
Receiving error message:
'set enabled to true to successfully start the service'
start_service_{{ service_name }}:
  service.running:
  - name: {{ service_name }}
#}

{% if salt['service.start'](service_name) == True %}
start_service_{{ service_name }}:
  test.show_notification:
    - text: {{ service_name }} started
{% else %}
failed_to_start_service_{{ service_name }}:
  test.fail_without_changes:
    - text: {{ service_name }} failed to start
{% endif %}

My final Windows service should look the following way:
Manual (Service should not be started at the boot time)
Running (service.running state)

If I try to set 'enable: True' and run service.disabled, service becomes:
Disabled
Running

Ideally we should have three types of 'enable' state that is:

  • Manual (NEW FEATURE)
  • Automatic (True)
  • Disabled (False)
  • None (currently does not allow to start service)

I am wondering what was the reason reason behind this implementation, is there any Microsoft article that explicitly says that the service MUST be enabled in order to run?

Reference commit by @weswhet @dwoz :
https://github.com/saltstack/salt/commit/4798babaef859ac39c1499bba12680580cf3e5c4#diff-2f7c8c335ccacbfa84a72e52f66a67fd926e52f221ca9807ad7f7ed3814d0962R517

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.