Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load-service: Minor fixes around setting handling #376

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/includes/load-service.h
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,8 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
settings.log_type = log_type_id::PIPE;
}
else {
throw service_description_exc(name, "log type must be one of: \"file\", \"buffer\" or \"none\"",
"log-type", input_pos);
throw service_description_exc(name, "log type must be one of: \"file\", \"buffer\", \"pipe\","
" or \"none\"", "log-type", input_pos);
}
break;
}
Expand Down Expand Up @@ -1644,15 +1644,28 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
else if (restart == "on-failure") {
settings.auto_restart = auto_restart_mode::ON_FAILURE;
}
else {
else if (restart == "no" || restart == "false") {
settings.auto_restart = auto_restart_mode::NEVER;
}
else {
throw service_description_exc(name, "restart must be one of: \"yes\", \"true\","
" \"no\", \"false\" or \"on-failure\"", "restart", input_pos);
}
break;
}
case setting_id_t::SMOOTH_RECOVERY:
{
string recovery = read_setting_value(input_pos, i, end);
settings.smooth_recovery = (recovery == "yes" || recovery == "true");
if (recovery == "yes" || recovery == "true") {
settings.smooth_recovery = true;
}
else if (recovery == "no" || recovery == "false") {
settings.smooth_recovery = false;
}
else {
throw service_description_exc(name, "smooth-recovery must be one of: \"yes\","
" \"true\", \"no\" or \"false\"", "smooth-recovery", input_pos);
}
break;
}
case setting_id_t::TYPE:
Expand Down