Kea: main.cc Source File

| Kea 3.2.0-git

lfc/main.cc
Go to the documentation of this file.
1// Copyright (C) 2015-2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8#include <lfc/lfc_controller.h>
9#include <exceptions/exceptions.h>
10#include <log/logger_support.h>
11#include <log/logger_manager.h>
12#include <util/filesystem.h>
13#include <boost/exception/diagnostic_information.hpp>
14#include <boost/exception_ptr.hpp>
15#include <iostream>
16
17using namespace std;
18using namespace isc::lfc;
19
26 int main(int argc, char* argv[]) {
27 isc::util::file::setUmask();
28
29 int ret = EXIT_SUCCESS;
30 try {
31 LFCController lfc_controller;
32
33 // Launch the controller passing in command line arguments.
34 // Exit program with the controller's return code.
35
36 // 'false' value disables test mode.
37 lfc_controller.launch(argc, argv, false);
38
39 } catch (const boost::exception& ex) {
40 std::cerr << boost::diagnostic_information(ex) << std::endl;
41 ret = EXIT_FAILURE;
42 } catch (const std::exception& ex) {
43 std::cerr << "Service failed: " << ex.what() << std::endl;
44 ret = EXIT_FAILURE;
45 } catch (...) {
46 std::cerr << "Service failed" << std::endl;
47 ret = EXIT_FAILURE;
48 }
49
50 return (ret);
51}
isc::lfc::LFCController
Process controller for LFC process.
Definition lfc_controller.h:37
isc::lfc::LFCController::launch
void launch(int argc, char *argv[], const bool test_mode)
Acts as the primary entry point to start execution of the process.
Definition lfc_controller.cc:60
exceptions.h
filesystem.h
main
int main(int argc, char *argv[])
This file contains the entry point (main() function) for the standard LFC process,...
Definition lfc/main.cc:26
lfc_controller.h
logger_manager.h
logger_support.h
Logging initialization functions.
isc::lfc
Definition lfc_controller.cc:42
isc::util::file::setUmask
void setUmask()
Set umask (at least 0027 i.e. no group write and no other access).
Definition filesystem.cc:98