service record: move read_pid_file into bgproc_service
authorDavin McCall <davmac@davmac.org>
Tue, 30 May 2017 09:29:31 +0000 (10:29 +0100)
committerDavin McCall <davmac@davmac.org>
Tue, 30 May 2017 09:29:31 +0000 (10:29 +0100)
src/service.cc
src/service.h

index 3d66e3a50102254381c425e84cc7c3c609d5f15e..375d66b9919cdf5bdfbfdeb3b1ea6c54c83e6068 100644 (file)
@@ -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);
index ebe74b5126c1fd1b9257a887bd0be30080d6b224..9468e4d1d9d305c082ef356746b0c814d71b5771 100644 (file)
@@ -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<std::pair<unsigned,unsigned>> &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<std::pair<unsigned,unsigned>> &command_offsets,