diff --git a/agents/ocf/attribute.in b/agents/ocf/attribute.in index ade3a1c26ac..ced807e3d3f 100755 --- a/agents/ocf/attribute.in +++ b/agents/ocf/attribute.in @@ -2,7 +2,7 @@ # # ocf:pacemaker:attribute resource agent # -# Copyright 2016-2023 the Pacemaker project contributors +# Copyright 2016-2024 the Pacemaker project contributors # # The version control history for this file may have further details. # @@ -14,15 +14,16 @@ USAGE="Usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-d Expects to have a fully populated OCF RA-compliant environment set." -# Load OCF helper functions +# If the OCF helper funtions aren't available, we can still show metadata. : ${OCF_FUNCTIONS:="${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs"} -. "${OCF_FUNCTIONS}" +[ -r "${OCF_FUNCTIONS}" ] && . "${OCF_FUNCTIONS}" + : ${__OCF_ACTION:="$1"} # Ensure certain variables are set and not empty -: ${HA_VARRUN:="/var/run"} +: ${HA_VARRUN:="@runstatedir@"} : ${OCF_RESKEY_CRM_meta_globally_unique:="false"} -: ${OCF_RESOURCE_INSTANCE:="undef"} +: ${OCF_RESOURCE_INSTANCE:="RESOURCENAME"} DEFAULT_STATE_FILE="${HA_VARRUN%%/}/opa-${OCF_RESOURCE_INSTANCE}.state" if [ "${OCF_RESKEY_CRM_meta_globally_unique}" = "false" ]; then diff --git a/daemons/pacemakerd/pcmkd_subdaemons.c b/daemons/pacemakerd/pcmkd_subdaemons.c index b87a9b4ecb2..a06c348a2d9 100644 --- a/daemons/pacemakerd/pcmkd_subdaemons.c +++ b/daemons/pacemakerd/pcmkd_subdaemons.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -452,7 +453,7 @@ start_child(pcmk_child_t * child) use_valgrind = FALSE; } - if ((child->uid != 0) && (crm_user_lookup(child->uid, &uid, &gid) < 0)) { + if ((child->uid != NULL) && (crm_user_lookup(child->uid, &uid, &gid) < 0)) { crm_err("Invalid user (%s) for subdaemon %s: not found", child->uid, child->name); return EACCES; diff --git a/doc/sphinx/Pacemaker_Explained/resources.rst b/doc/sphinx/Pacemaker_Explained/resources.rst index 54e9d99e175..a2781604725 100644 --- a/doc/sphinx/Pacemaker_Explained/resources.rst +++ b/doc/sphinx/Pacemaker_Explained/resources.rst @@ -40,7 +40,7 @@ more detail below: * lsb * systemd * service -* stonithd +* stonith * nagios *(deprecated since 2.1.6)* * upstart *(deprecated since 2.1.0)* diff --git a/lib/common/strings.c b/lib/common/strings.c index c4be799a43e..38d8f156adf 100644 --- a/lib/common/strings.c +++ b/lib/common/strings.c @@ -482,7 +482,7 @@ pcmk_parse_interval_spec(const char *input, guint *result_ms) msec = crm_get_msec(input); } - if (msec == PCMK__PARSE_INT_DEFAULT) { + if (msec < 0) { crm_warn("Using 0 instead of invalid interval specification '%s'", input); msec = 0; diff --git a/mk/common.mk b/mk/common.mk index 4c92a0f0dc0..40fb9cbc0f4 100644 --- a/mk/common.mk +++ b/mk/common.mk @@ -37,6 +37,4 @@ am__v_BOOK_1 = MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/libltdl \ - -I$(top_srcdir)/libltdl + -I$(top_srcdir)/include diff --git a/tools/crmadmin.8.inc b/tools/crmadmin.8.inc index ab5efbe0a92..b5e2797ecb7 100644 --- a/tools/crmadmin.8.inc +++ b/tools/crmadmin.8.inc @@ -3,3 +3,6 @@ crmadmin [options] [node] /the Pacemaker controller/ .SH OPTIONS + +/query information/ +.SH NOTES diff --git a/tools/crmadmin.c b/tools/crmadmin.c index 082904fb14d..275d51bad2c 100644 --- a/tools/crmadmin.c +++ b/tools/crmadmin.c @@ -38,6 +38,7 @@ struct { char *ipc_name; gboolean bash_export; } options = { + .timeout = 30000, // Default to 30 seconds .optarg = NULL, .ipc_name = NULL, .bash_export = FALSE @@ -80,9 +81,10 @@ static GOptionEntry command_options[] = { static GOptionEntry additional_options[] = { { "timeout", 't', 0, G_OPTION_ARG_CALLBACK, command_cb, - "Time to wait before declaring the operation" - "\n failed", - "TIMESPEC" + "Time to wait before declaring the operation" + "\n " + "failed (default 30s; use 0 to disable timeout)", + "DURATION" }, { "bash-export", 'B', 0, G_OPTION_ARG_NONE, &options.bash_export, "Display nodes as shell commands of the form 'export uname=uuid'" @@ -131,17 +133,18 @@ static pcmk__supported_format_t formats[] = { { NULL, NULL, NULL } }; +#define DESC \ + "Notes:\n\n" \ + "DURATION in any command line option can be specified as an integer\n" \ + "number of seconds, an integer plus units (ms, msec, us, usec, s, sec,\n" \ + "m, min, h, or hr), or an ISO 8601 period specification.\n\n" \ + "Report bugs to " PCMK__BUG_URL + + static GOptionContext * build_arg_context(pcmk__common_args_t *args, GOptionGroup **group) { GOptionContext *context = NULL; - const char *description = "Notes:\n\n" - "Time Specification:\n\n" - "The TIMESPEC in any command line option can be specified in many different\n" - "formats. It can be just an integer number of seconds, a number plus units\n" - "(ms/msec/us/usec/s/sec/m/min/h/hr), or an ISO 8601 period specification.\n\n" - "Report bugs to " PCMK__BUG_URL; - GOptionEntry extra_prog_entries[] = { { "quiet", 'q', 0, G_OPTION_ARG_NONE, &(args->quiet), "Display only the essential query information", @@ -151,7 +154,7 @@ build_arg_context(pcmk__common_args_t *args, GOptionGroup **group) { }; context = pcmk__build_arg_context(args, "text (default), xml", group, NULL); - g_option_context_set_description(context, description); + g_option_context_set_description(context, DESC); /* Add the -q option, which cannot be part of the globally supported options * because some tools use that flag for something else.