From: Davin McCall Date: Tue, 30 May 2017 09:29:31 +0000 (+0100) Subject: service record: move read_pid_file into bgproc_service X-Git-Tag: v0.06~115 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e09af92fefef08d09e62b25a7c19c2c9ecc0b0f1;p=oweals%2Fdinit.git service record: move read_pid_file into bgproc_service --- 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,