-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for agent self-restarting on Linux #386
Merged
MarcelKemp
merged 1 commit into
master
from
enhancement/77-add-support-agent-self-restarting
Jan 28, 2025
Merged
Add support for agent self-restarting on Linux #386
MarcelKemp
merged 1 commit into
master
from
enhancement/77-add-support-agent-self-restarting
Jan 28, 2025
Conversation
This file contains 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
5 tasks
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
from
December 4, 2024 14:20
e65a3ff
to
d0089ef
Compare
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
4 times, most recently
from
December 10, 2024 01:33
fdda710
to
c009b4a
Compare
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
9 times, most recently
from
December 20, 2024 00:09
6124ac7
to
3a71fae
Compare
lchico
commented
Dec 20, 2024
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
9 times, most recently
from
December 24, 2024 03:09
6a2deb8
to
3ca559f
Compare
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
4 times, most recently
from
January 14, 2025 02:53
ab9cf22
to
f40fc98
Compare
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
11 times, most recently
from
January 27, 2025 13:36
74ecea0
to
e3a107d
Compare
TomasTurina
reviewed
Jan 27, 2025
src/agent/command_handler/include/command_entry/command_entry.hpp
Outdated
Show resolved
Hide resolved
TomasTurina
reviewed
Jan 27, 2025
TomasTurina
reviewed
Jan 27, 2025
TomasTurina
reviewed
Jan 27, 2025
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
from
January 27, 2025 16:09
e3a107d
to
f15e38e
Compare
jr0me
approved these changes
Jan 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments, mostly on formatting and style, but already LGTM
feat: Address comments and improve the code
lchico
force-pushed
the
enhancement/77-add-support-agent-self-restarting
branch
from
January 28, 2025 02:52
f15e38e
to
762a256
Compare
TomasTurina
approved these changes
Jan 28, 2025
vikman90
changed the title
Add support for agent self-restarting: Development Phase
Add support for agent self-restarting on Linux
Jan 28, 2025
MarcelKemp
approved these changes
Jan 28, 2025
vikman90
approved these changes
Jan 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we've got just one process:
SessionLeader───Relay(130993)───bash───wazuh-agent───6*[{wazuh-agent}]
Thanks @lchico!
This was
unlinked from
issues
Jan 28, 2025
MarcelKemp
deleted the
enhancement/77-add-support-agent-self-restarting
branch
January 28, 2025 17:30
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.
Description
Base on the design phase, this PR implement how to handles the Wazuh agent restart process. Upon receiving a restart command, the program identifies the restart method (systemd or manual). It ensures the agent is stopped with a 30-second timeout, then restarts it. If the agent doesn’t stop gracefully, it is forcefully terminated. The process includes confirmation of the agent's successful restart.
Implementation Details:
Extra changes:
Test
Server
Add the restart command action to
src/tests/mock-server/config/commands.groovy
Agent
Configure the agent to use the server address:
sed -i 's|server_url:.*|server_url: http://192.168.100.250:27000 |' /etc/wazuh-agent/wazuh-agent.yml
Register the agent
Manually run the agent
Using Systemd to run the agent