Repository navigation
Server agent installs always disable sleep/hibernate (--power) - #2584
Open
andrewsbejatto wants to merge 1 commit into
Open
andrewsbejatto wants to merge 1 commit into
andrewsbejatto wants to merge 1 commit into
Conversation
The dashboard only shows the "Disable sleep/hibernate" option for workstation installs, so a server install always went out with power=0. A Windows 10/11 machine used as a server could then go to sleep. Windows Server has no sleep by default, but desktop editions do. install_power_flag() forces power=1 for server installs and keeps the requested value for workstations. It is used by install_agent (exe, powershell and manual/bash commands) and generate_winagent_exe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dashboard only shows the Disable sleep/hibernate option for workstation installs, so every server install went out with
power=0. A Windows 10/11 machine used as a server could then go to sleep. Windows Server has no sleep by default, but desktop editions do.install_power_flag(agent_type, power)intacticalrmm/utils.py:serveralways returns1, workstations keep the requested value (invalid/missing values become0).install_agentfor all methods (exe, powershell, manual/bash command) and bygenerate_winagent_exe.Testing
tacticalrmm.tests.TestUtils.test_install_power_flag(new).agents.tests.test_agent_installs.test_install_agent: the server exe install now expectspower=1, and a workstation install keepspower=0.black --checkandflake8on the changed files.🤖 Generated with Claude Code