docs/ref/modules/control/README.md
The Control Module (wm_control) provides manager control operations for the Wazuh server, handling restart and reload requests through a Unix domain socket interface. This module runs within wazuh-modulesd and replaces the control functionality previously handled by wazuh-execd.
ErrThe control module serves as the manager's control plane for operational commands. It:
/var/ossec/queue/sockets/control)This module is enabled for manager builds (TARGET=manager) on Unix-like systems.
Socket Path: /var/ossec/queue/sockets/control
Socket Type: Unix domain stream socket (SOCK_STREAM)
Protocol: Simple text-based command protocol
| Command | Description | Response |
|---|---|---|
restart | Restart the Wazuh manager | ok (immediate) |
reload | Reload manager configuration | ok (immediate) |
| (other) | Any unrecognized command | Err |
systemctl restart/reload wazuh-managerbin/wazuh-control restart/reloadThe module detects systemd by checking:
/run/systemd/system directorysystemd (read from /proc/1/comm)For reload operations with systemd, the module:
The Wazuh RESTful API uses the control socket for:
PUT /manager/restart - Manager restart endpointFramework Code: framework/wazuh/core/cluster/utils.py::manager_restart()
import socket
def send_control_command(command):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect('/var/ossec/queue/sockets/control')
sock.send(command.encode())
response = sock.recv(1024).decode().strip()
sock.close()
return response
# Restart manager
result = send_control_command('restart') # Returns: "ok "
Previous Architecture (v4.x):
wazuh-execd daemon/var/ossec/queue/sockets/comCurrent Architecture (v5.0):
wm_control module (within modulesd)/var/ossec/queue/sockets/control0660 permissions| Document | Description |
|---|---|
| Architecture | Technical architecture and implementation details |