From e09af92fefef08d09e62b25a7c19c2c9ecc0b0f1 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Tue, 30 May 2017 10:29:31 +0100 Subject: [PATCH] service record: move read_pid_file into bgproc_service --- src/service.cc | 2 +- src/service.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/service.cc b/src/service.cc index 3d66e3a..375d66b 100644 --- a/src/service.cc +++ b/src/service.cc @@ -664,7 +664,7 @@ void ServiceRecord::acquiredConsole() noexcept } } -bool base_process_service::read_pid_file() noexcept +bool bgproc_service::read_pid_file() noexcept { const char *pid_file_c = pid_file.c_str(); int fd = open(pid_file_c, O_CLOEXEC); diff --git a/src/service.h b/src/service.h index ebe74b5..9468e4d 100644 --- a/src/service.h +++ b/src/service.h @@ -567,9 +567,6 @@ class base_process_service : public ServiceRecord virtual void all_deps_stopped() noexcept; virtual void handle_exit_status(int exit_status) noexcept = 0; - // Read the pid-file, return false on failure - bool read_pid_file() noexcept; - public: base_process_service(ServiceSet *sset, string name, ServiceType service_type, string &&command, std::list> &command_offsets, @@ -609,6 +606,9 @@ class bgproc_service : public base_process_service bool doing_recovery : 1; // if we are currently recovering a BGPROCESS (restarting process, while // holding STARTED service state) + // Read the pid-file, return false on failure + bool read_pid_file() noexcept; + public: bgproc_service(ServiceSet *sset, string name, string &&command, std::list> &command_offsets, -- 2.25.1