shmmonitor: non-interactive mode checks and quits

This commit is contained in:
Alexey Rybalchenko
2021-02-09 23:28:39 +01:00
parent c6b13cd3a1
commit 2b3e38d9a4
2 changed files with 25 additions and 29 deletions

View File

@@ -125,13 +125,12 @@ int main(int argc, char** argv)
}
cout << "Starting shared memory monitor for session: \"" << sessionName << "\" (shmId: " << shmId << ")..." << endl;
if (viewOnly && !interactive) {
cout << "running in non-interactive view-only mode, outputting with interval of " << intervalInMS << "ms. (change with --interval), press ctrl+C to exit." << endl;
}
Monitor monitor(shmId, selfDestruct, interactive, viewOnly, timeoutInMS, intervalInMS, runAsDaemon, cleanOnExit);
monitor.CatchSignals();
if (interactive || !viewOnly) {
monitor.CatchSignals();
}
monitor.Run();
} catch (Monitor::DaemonPresent& dp) {
return 0;