2014-12-18 18:50:47 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-12-03 23:14:02 +00:00
|
|
|
#include <osquery/core.h>
|
|
|
|
#include <osquery/database.h>
|
|
|
|
#include <osquery/devtools.h>
|
|
|
|
#include <osquery/events.h>
|
2014-07-31 00:35:19 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
2014-11-09 04:27:28 +00:00
|
|
|
osquery::FLAGS_db_path = "/tmp/rocksdb-osquery-shell";
|
|
|
|
osquery::initOsquery(argc, argv, osquery::OSQUERY_TOOL_SHELL);
|
2014-09-23 01:35:12 +00:00
|
|
|
|
|
|
|
// Start a thread for each appropriate event type
|
2014-10-27 18:55:28 +00:00
|
|
|
osquery::registries::faucet(REGISTERED_EVENTPUBLISHERS,
|
2014-10-28 00:37:36 +00:00
|
|
|
REGISTERED_EVENTSUBSCRIBERS);
|
2014-09-23 01:35:12 +00:00
|
|
|
osquery::EventFactory::delay();
|
|
|
|
|
|
|
|
int retcode = osquery::launchIntoShell(argc, argv);
|
|
|
|
|
|
|
|
// End any event type threads.
|
|
|
|
osquery::EventFactory::end();
|
|
|
|
return retcode;
|
2014-07-31 00:35:19 +00:00
|
|
|
}
|