1 /* 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 26 static constexpr const char *sysdActionStartUnit = "StartUnit"; 27 static constexpr const char *sysdActionStopUnit = "StopUnit"; 28 29 void systemdDaemonReload( 30 const std::shared_ptr<sdbusplus::asio::connection> &conn); 31 32 void systemdUnitAction(const std::shared_ptr<sdbusplus::asio::connection> &conn, 33 const std::string &unitName, 34 const std::string &actionMethod); 35 36 void systemdUnitFileStateChange( 37 const std::shared_ptr<sdbusplus::asio::connection> &conn, 38 const std::string &unitName, const std::string &unitState); 39 40 bool checkSystemdUnitExist(const std::string &unitName); 41