Skip to content

Commit

Permalink
fix: force disable ipc server in jmx and check commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pgimalac committed Feb 26, 2025
1 parent 87fa9cd commit 2bd56c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/agent/subcommands/jmx/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
// Ideally, the server wouldn't start up at all, but this workaround has been
// in place for some times.
func disableCmdPort() {
os.Setenv("DD_CMD_PORT", "0") // 0 indicates the OS should pick an unused port
os.Setenv("DD_CMD_PORT", "0") // 0 indicates the OS should pick an unused port
os.Setenv("DD_AGENT_IPC_PORT", "0") // force disable the IPC server
}

// runJmxCommandConsole sets up the common utils necessary for JMX, and executes the command
Expand Down
3 changes: 2 additions & 1 deletion pkg/cli/subcommands/check/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,5 +772,6 @@ func populateMemoryProfileConfig(cliParams *cliParams, initConfig map[string]int
// Ideally, the server wouldn't start up at all, but this workaround has been
// in place for some time.
func disableCmdPort() {
os.Setenv("DD_CMD_PORT", "0") // 0 indicates the OS should pick an unused port
os.Setenv("DD_CMD_PORT", "0") // 0 indicates the OS should pick an unused port
os.Setenv("DD_AGENT_IPC_PORT", "0") // force disable the IPC server
}

0 comments on commit 2bd56c4

Please sign in to comment.