Bug 269779 - sysutils/datadog-agent: datadog agent error
Summary: sysutils/datadog-agent: datadog agent error
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-23 13:30 UTC by alexis.cimpu
Modified: 2023-02-23 13:30 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (uros)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexis.cimpu 2023-02-23 13:30:36 UTC
Datadog agent fails to restart on freebsd with the error below if the agent is already stopped:

# service datadog-agent restart
Error: Error stopping the agent: Post "https://localhost:5001/agent/stop": dial tcp [::1]:5001: connect: operation timed out

Current workaround that seems to fix the problem is adding a check and a sleep in the stop or restart in rc.d of datadogagent 
Below is a snip of current datadogagent rc.d
datadog_agent_restart()
{
        datadog_agent_stop &&  sleep 3 && datadog_agent_start
        return $?
}


datadog_agent_stop() {
        rc_pid=`check_pidfile ${pidfile} ${command}`
        if [ -n "${rc_pid}" ]; then
                ${command} ${command_args} stop
        fi
        return $?
}