36 lines
901 B
C++
36 lines
901 B
C++
#include <QCoreApplication>
|
|
#include <QCommandLineParser>
|
|
#include <signal.h>
|
|
#include "src/utils/logs/logging.h"
|
|
#include "src/core/CoreService.h"
|
|
|
|
void signalHandler(int signal)
|
|
{
|
|
LOG_INFO() << "Received signal:" << signal;
|
|
QCoreApplication::quit();
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication app(argc, argv);
|
|
app.setApplicationName("soft_bus_daemon");
|
|
app.setApplicationVersion("1.0.0");
|
|
app.setOrganizationName("soft_bus");
|
|
|
|
QCommandLineParser parser;
|
|
parser.setApplicationDescription(QStringLiteral("Soft Bus Daemon"));
|
|
parser.addHelpOption();
|
|
parser.addVersionOption();
|
|
parser.process(app);
|
|
|
|
LOG_INFO() << "Starting Soft Bus Daemon";
|
|
|
|
signal(SIGINT, signalHandler);
|
|
signal(SIGTERM, signalHandler);
|
|
|
|
CoreService::instance()->initialize();
|
|
int ret = app.exec();
|
|
CoreService::instance()->shutdown();
|
|
return ret;
|
|
}
|