blob: 67ced4c342543859174acc08b068242d41931896 [file] [log] [blame]
AppaRao Puli00840472018-10-03 19:37:46 +05301/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16#pragma once
17#include <ctime>
18#include <chrono>
19#include <string>
20#include <sdbusplus/asio/object_server.hpp>
21#include <phosphor-logging/elog-errors.hpp>
22#include <xyz/openbmc_project/Common/error.hpp>
23#include <experimental/filesystem>
24#include <boost/asio.hpp>
25
26static constexpr const char *sysdActionStartUnit = "StartUnit";
27static constexpr const char *sysdActionStopUnit = "StopUnit";
28
29void systemdDaemonReload(
30 const std::shared_ptr<sdbusplus::asio::connection> &conn);
31
32void systemdUnitAction(const std::shared_ptr<sdbusplus::asio::connection> &conn,
33 const std::string &unitName,
34 const std::string &actionMethod);
35
36void systemdUnitFileStateChange(
37 const std::shared_ptr<sdbusplus::asio::connection> &conn,
38 const std::string &unitName, const std::string &unitState);
39
40bool checkSystemdUnitExist(const std::string &unitName);