-
Notifications
You must be signed in to change notification settings - Fork 32
Fix: sbd-pacemaker: sync with pacemakerd for robustness #113
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,7 @@ bool do_flush = true; | |
| char timeout_sysrq_char = 'b'; | ||
| bool move_to_root_cgroup = true; | ||
| bool enforce_moving_to_root_cgroup = false; | ||
| bool sync_resource_startup = false; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice if the default were true when USE_PACEMAKERD_API is set, but pacemaker would have no way of knowing that. I can think of a couple of ways around that:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, a pitty that the default has to be false to serve its purpose :-( |
||
|
|
||
| int parse_device_line(const char *line); | ||
|
|
||
|
|
@@ -964,6 +965,25 @@ int main(int argc, char **argv, char **envp) | |
| } | ||
| } | ||
|
|
||
| value = getenv("SBD_SYNC_RESOURCE_STARTUP"); | ||
| if(value) { | ||
| sync_resource_startup = crm_is_true(value); | ||
| } | ||
| #if !USE_PACEMAKERD_API | ||
| if (sync_resource_startup) { | ||
| fprintf(stderr, "Failed to sync resource-startup as " | ||
| "SBD was built against pacemaker not supporting pacemakerd-API.\n"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fprintf() or cl_log()?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that is an arguable point. using fprintf is at least consistent as all early-error-exits are using fprintf so far. if changed I guess it should be done consistently as an own commit. |
||
| exit_status = -1; | ||
| goto out; | ||
| } | ||
| #else | ||
| if (!sync_resource_startup) { | ||
| cl_log(LOG_WARNING, "SBD built against pacemaker supporting " | ||
| "pacemakerd-API. Should think about enabling " | ||
| "SBD_SYNC_RESOURCE_STARTUP."); | ||
| } | ||
| #endif | ||
|
|
||
| while ((c = getopt(argc, argv, "czC:DPRTWZhvw:d:n:p:1:2:3:4:5:t:I:F:S:s:r:")) != -1) { | ||
| switch (c) { | ||
| case 'D': | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.