* transition stage, at the latest.
*/
-struct onstart_flags_t {
+struct service_flags_t {
// on-start flags:
bool rw_ready : 1; // file system should be writable once this service starts
bool log_ready : 1; // syslog should be available once this service starts
bool start_interruptible : 1; // the startup of this service process is ok to interrupt with SIGINT
bool skippable : 1; // if interrupted the service is skipped (scripted services)
- onstart_flags_t() noexcept : rw_ready(false), log_ready(false),
+ service_flags_t() noexcept : rw_ready(false), log_ready(false),
no_sigterm(false), runs_on_console(false), starts_on_console(false),
pass_cs_fd(false), start_interruptible(false), skippable(false)
{
protected:
string pid_file;
- onstart_flags_t onstart_flags;
+ service_flags_t onstart_flags;
string logfile; // log file name, empty string specifies /dev/null
}
// Set "on start" flags (commands)
- void set_flags(onstart_flags_t flags) noexcept
+ void set_flags(service_flags_t flags) noexcept
{
this->onstart_flags = flags;
}
service_type_t service_type = service_type_t::PROCESS;
std::list<prelim_dep> depends;
string logfile;
- onstart_flags_t onstart_flags;
+ service_flags_t onstart_flags;
int term_signal = -1; // additional termination signal
bool auto_restart = false;
bool smooth_recovery = false;
extern eventloop_t event_loop;
constexpr static auto REG = dependency_type::REGULAR;
-constexpr static auto WAITS = dependency_type::WAITS_FOR;
-constexpr static auto MS = dependency_type::MILESTONE;
// Friend interface to access base_process_service private/protected members.
class base_process_service_test
scripted_service p = scripted_service(&sset, "testscripted", std::move(command), command_offsets, depends);
init_service_defaults(p);
- onstart_flags_t sflags;
+ service_flags_t sflags;
sflags.skippable = true;
p.set_flags(sflags);
sset.add_service(&p);
scripted_service p = scripted_service(&sset, "testscripted", std::move(command), command_offsets, depends);
init_service_defaults(p);
- onstart_flags_t sflags;
+ service_flags_t sflags;
sflags.skippable = true;
sflags.start_interruptible = true;
p.set_flags(sflags);
// Create s1 and s2. s2 depends on s1, and starts on the console.
test_service *s1 = new test_service(&sset, "test-service-1", service_type_t::INTERNAL, {});
test_service *s2 = new test_service(&sset, "test-service-2", service_type_t::INTERNAL, {{s1, REG}});
- onstart_flags_t s2_flags;
+ service_flags_t s2_flags;
s2_flags.starts_on_console = true;
s2->set_flags(s2_flags);
sset.add_service(s1);
// Create s3, which starts and runs on console:
test_service *s3 = new test_service(&sset, "test-service-3", service_type_t::INTERNAL, {});
- onstart_flags_t s3_flags;
+ service_flags_t s3_flags;
s3_flags.starts_on_console = true;
s3_flags.runs_on_console = true;
sset.add_service(s3);