mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-06 18:43:46 +00:00
1. added 'slaveKvmLog' flag to msh, to enable Linux Child KVM logging
2. added support for child process core dumps in Linux (Note: core location must be writable by the process)
This commit is contained in:
@@ -29,12 +29,17 @@ limitations under the License.
|
||||
#include <X11/keysym.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#if !defined(_FREEBSD)
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
#include "linux_events.h"
|
||||
#include "linux_compression.h"
|
||||
|
||||
#define EXIT_SUCCESS 0
|
||||
#define EXIT_FAILURE 1
|
||||
extern uint32_t crc32c(uint32_t crc, const unsigned char* buf, uint32_t len);
|
||||
extern char* g_ILibCrashDump_path;
|
||||
|
||||
typedef enum KVM_MouseCursors
|
||||
{
|
||||
@@ -617,7 +622,6 @@ void* kvm_server_mainloop(void* parm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_messageQ = ILibQueue_Create();
|
||||
|
||||
// Init the kvm
|
||||
@@ -1010,6 +1014,19 @@ void* kvm_relay_restart(int paused, void *processPipeMgr, ILibKVM_WriteHandler w
|
||||
if (SLAVELOG != 0) { logFile = fopen("/tmp/slave", "w"); }
|
||||
if (uid != 0) { ignore_result(setuid(uid)); }
|
||||
|
||||
if (g_ILibCrashDump_path != NULL)
|
||||
{
|
||||
#if !defined(_FREEBSD)
|
||||
prctl(PR_SET_DUMPABLE, 1);
|
||||
if (logFile) { fprintf(logFile, "SLAVE/KVM DUMPABLE: %s\n", prctl(PR_GET_DUMPABLE, 0)?"YES":"NO"); fflush(logFile); }
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logFile) { fprintf(logFile, "SLAVE/KVM CoreDumps DISABLED\n"); fflush(logFile); }
|
||||
}
|
||||
|
||||
|
||||
//fprintf(logFile, "Starting kvm_server_mainloop\n");
|
||||
if (authToken != NULL) { setenv("XAUTHORITY", authToken, 1); }
|
||||
if (dispid != NULL) { setenv("DISPLAY", dispid, 1); }
|
||||
|
||||
@@ -3389,6 +3389,10 @@ void MeshServer_Connect(MeshAgentHostContainer *agent)
|
||||
agent->logUpdate = ILibSimpleDataStore_Get(agent->masterDb, "logUpdate", NULL, 0);
|
||||
agent->fakeUpdate = ILibSimpleDataStore_Get(agent->masterDb, "fakeUpdate", NULL, 0);
|
||||
agent->controlChannelDebug = ILibSimpleDataStore_Get(agent->masterDb, "controlChannelDebug", NULL, 0);
|
||||
|
||||
#if defined(_LINKVM) && defined(_POSIX) && !defined(__APPLE__)
|
||||
SLAVELOG = ILibSimpleDataStore_Get(agent->masterDb, "slaveKvmLog", NULL, 0);
|
||||
#endif
|
||||
|
||||
if (agent->logUpdate != 0) { ILIBLOGMESSAGEX("PLATFORM_TYPE: %d\n", agent->platformType); }
|
||||
if (agent->logUpdate != 0) { ILIBLOGMESSAGEX("Running as Service: %d\n", agent->JSRunningAsService); }
|
||||
|
||||
@@ -258,6 +258,7 @@ forceUpdate: If set, will cause the agent to perform a self-update on next st
|
||||
ignoreProxyFile: If set, will cause the agent to ignore any proxy settings
|
||||
logUpdate: If set, will cause the agent to log self-update status
|
||||
jsDebugPort: Specify a JS Debugger Port
|
||||
slaveKvmLog: [Linux] If set, will enable logging inside the Child KVM Process.
|
||||
WebProxy: Manually specify proxy configuration
|
||||
webSocketMaskOverride: If set, will disable the optimzation to skip WebSocket Masking for TLS protected Web Sockets
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user