From 4a6028c9a9bf40708cf9e665701d1a87b724060b Mon Sep 17 00:00:00 2001 From: chunmei Liu Date: Tue, 7 May 2019 13:56:35 -0700 Subject: [PATCH] crimson/osd: support write pid_file when osd start Signed-off-by: chunmei Liu --- src/crimson/CMakeLists.txt | 1 + src/crimson/osd/main.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/crimson/CMakeLists.txt b/src/crimson/CMakeLists.txt index a895fe20e01..22c2266fe97 100644 --- a/src/crimson/CMakeLists.txt +++ b/src/crimson/CMakeLists.txt @@ -70,6 +70,7 @@ add_library(crimson-common STATIC ${PROJECT_SOURCE_DIR}/src/common/Thread.cc ${PROJECT_SOURCE_DIR}/src/common/HeartbeatMap.cc ${PROJECT_SOURCE_DIR}/src/common/PluginRegistry.cc + ${PROJECT_SOURCE_DIR}/src/global/pidfile.cc ${PROJECT_SOURCE_DIR}/src/librbd/Features.cc ${PROJECT_SOURCE_DIR}/src/log/Log.cc ${PROJECT_SOURCE_DIR}/src/mgr/ServiceMap.cc diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index 608905b912c..449f0cc35d6 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -13,6 +13,7 @@ #include "common/ceph_argparse.h" #include "crimson/common/config_proxy.h" #include "crimson/net/SocketMessenger.h" +#include "global/pidfile.h" #include "osd.h" @@ -105,6 +106,7 @@ int main(int argc, char* argv[]) }); local_conf().parse_config_files(conf_file_list).get(); local_conf().parse_argv(ceph_args).get(); + pidfile_write(local_conf()->pid_file); const int whoami = std::stoi(local_conf()->name.get_id()); const auto nonce = static_cast(getpid()); for (auto [msgr, name] : {make_pair(std::ref(cluster_msgr), "cluster"s), -- 2.39.5