}
}
else if (setting == "onstart") {
+ // deprecated
std::list<std::pair<unsigned,unsigned>> indices;
string onstart_cmds = read_setting_value(i, end, &indices);
for (auto indexpair : indices) {
if (onstart_cmd == "rw_ready") {
onstart_flags.rw_ready = true;
}
+ else if (onstart_cmd == "log_ready") {
+ onstart_flags.log_ready = true;
+ }
else {
throw new ServiceDescriptionExc(name, "Unknown onstart command: " + onstart_cmd);
}
}
}
+ else if (setting == "options") {
+ std::list<std::pair<unsigned,unsigned>> indices;
+ string onstart_cmds = read_setting_value(i, end, &indices);
+ for (auto indexpair : indices) {
+ string option_txt = onstart_cmds.substr(indexpair.first, indexpair.second - indexpair.first);
+ if (option_txt == "starts-rwfs") {
+ onstart_flags.rw_ready = true;
+ }
+ else if (option_txt == "starts-log") {
+ onstart_flags.log_ready = true;
+ }
+ else if (option_txt == "nosigterm") {
+ onstart_flags.no_sigterm = true;
+ }
+ else if (option_txt == "runs-on-console") {
+ onstart_flags.runs_on_console = true;
+ }
+ else {
+ throw new ServiceDescriptionExc(name, "Unknown option: " + option_txt);
+ }
+ }
+
+ }
else if (setting == "termsignal") {
string signame = read_setting_value(i, end, nullptr);
int signo = signalNameToNumber(signame);
}
}
else if (setting == "nosigterm") {
+ // deprecated
string sigtermsetting = read_setting_value(i, end);
onstart_flags.no_sigterm = (sigtermsetting == "yes" || sigtermsetting == "true");
}
else if (setting == "runs-on-console") {
+ // deprecated
string runconsolesetting = read_setting_value(i, end);
onstart_flags.runs_on_console = (runconsolesetting == "yes" || runconsolesetting == "true");
}
struct OnstartFlags {
bool rw_ready : 1;
+ bool log_ready : 1;
// Not actually "onstart" commands:
bool no_sigterm : 1; // do not send SIGTERM
bool runs_on_console : 1; // run "in the foreground"
- OnstartFlags() noexcept : rw_ready(false),
+ OnstartFlags() noexcept : rw_ready(false), log_ready(false),
no_sigterm(false), runs_on_console(false)
{
}