mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-31 01:24:19 +02:00
parent
e8a019d297
commit
87fa063528
@ -55,6 +55,12 @@ void LivestatusListener::Start(void)
|
|||||||
UnixSocket::Ptr socket = boost::make_shared<UnixSocket>();
|
UnixSocket::Ptr socket = boost::make_shared<UnixSocket>();
|
||||||
socket->Bind(GetSocketPath());
|
socket->Bind(GetSocketPath());
|
||||||
|
|
||||||
|
/* group must be able to write */
|
||||||
|
if (chmod(GetSocketPath().CStr(), 0660) < 0) {
|
||||||
|
Log(LogCritical, "livestatus", "Cannot chmod unix socket '" + GetSocketPath() + "' to 0660: " + strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
|
boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
|
||||||
thread.detach();
|
thread.detach();
|
||||||
#else
|
#else
|
||||||
@ -78,7 +84,7 @@ String LivestatusListener::GetSocketPath(void) const
|
|||||||
{
|
{
|
||||||
Value socketPath = m_SocketPath;
|
Value socketPath = m_SocketPath;
|
||||||
if (socketPath.IsEmpty())
|
if (socketPath.IsEmpty())
|
||||||
return Application::GetLocalStateDir() + "/run/icinga2/livestatus";
|
return Application::GetLocalStateDir() + "/run/icinga2/rw/livestatus";
|
||||||
else
|
else
|
||||||
return socketPath;
|
return socketPath;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user