PowerShell / PowerShell/Win32-OpenSSH

Manage service recovery options to avoid service restart loop

Open
#2,283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Setup
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Summary of the new feature / enhancement

If the sshd service fails to start it will not fail as all service recovery options are set to restart the service. This creates a loop of service restarts. As every service restart is logged - the event log will be filled with service restart log events ~ 1000 log entries per minute

PS C:\> sc qfailure sshd
[SC] QueryServiceConfig2 SUCCESS

SERVICE_NAME: sshd
        RESET_PERIOD (in seconds)    : 86400
        REBOOT_MESSAGE               :
        COMMAND_LINE                 :
        FAILURE_ACTIONS              : RESTART -- Delay = 0 milliseconds.
                                       RESTART -- Delay = 0 milliseconds.
                                       RESTART -- Delay = 0 milliseconds.

Suggestion:

  • Change the delays to 60000 for the first two failure actions
  • Change the third action to "Take no Action"
Proposed technical implementation details (optional)

No response

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.

Research direction

Start by locating where the Windows sshd service recovery actions are configured. Use sc qfailure sshd to inspect the current settings and verify the requested delays and final no-action behavior. Done means a failed sshd service no longer restarts in a tight loop and the recovery configuration matches the suggestion.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.