2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Jan Olszak (j.olszak@samsung.com)
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Jan Olszak (j.olszak@samsung.com)
22 * @brief Definition of the Runner class, that manages daemon's lifetime
28 #include "log/logger.hpp"
29 #include "utils/glib-loop.hpp"
30 #include "utils/latch.hpp"
35 namespace security_containers {
36 namespace container_daemon {
50 utils::Latch gSignalLatch;
52 void signalHandler(const int sig)
54 LOGI("Got signal " << sig);
62 signal(SIGINT, signalHandler);
63 signal(SIGTERM, signalHandler);
65 LOGI("Starting Container Daemon...");
67 utils::ScopedGlibLoop loop;
68 LOGI("Container Daemon started");
70 // Connects to dbus and registers API
71 container_daemon::Daemon daemon;
75 LOGI("Stopping Container Daemon...");
78 LOGI("Daemon stopped");
81 void Runner::terminate()
83 LOGI("Terminating Container Daemon");
87 } // namespace container_daemon
88 } // namespace security_containers