strncpy(inittab_line, line, sizeof(inittab_line));
}
+ // Get the utmp (inittab) id, may not be nul terminated if maximum length!
+ const char *get_utmp_id()
+ {
+ return inittab_id;
+ }
+
+ // Get the utmp (inittab) line, may not be nul terminated if maximum length!
+ const char *get_utmp_line()
+ {
+ return inittab_line;
+ }
+
+ constexpr size_t get_utmp_id_size() const { return sizeof(inittab_id); }
+ constexpr size_t get_utmp_line_size() const { return sizeof(inittab_line); }
+
#endif
~process_service() noexcept
TERMINATED // read pid successfully, but the process already terminated
};
- // Read the pid-file, return false on failure
+ string pid_file;
+
+ // Read the pid-file contents
pid_result_t read_pid_file(bp_sys::exit_status *exit_status) noexcept;
public:
~bgproc_service() noexcept
{
}
+
+ void set_pid_file(string &&pid_file) noexcept
+ {
+ this->pid_file = std::move(pid_file);
+ }
+
+ const std::string &get_pid_file() noexcept
+ {
+ return pid_file;
+ }
};
// Service which is started and stopped via separate commands