diff options
Diffstat (limited to '')
-rw-r--r-- | daemons/pacemakerd/pacemakerd.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/daemons/pacemakerd/pacemakerd.c b/daemons/pacemakerd/pacemakerd.c index 9f77ccc..365b743 100644 --- a/daemons/pacemakerd/pacemakerd.c +++ b/daemons/pacemakerd/pacemakerd.c @@ -92,7 +92,7 @@ pid_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **er static gboolean standby_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **err) { options.standby = TRUE; - pcmk__set_env_option("node_start_state", "standby"); + pcmk__set_env_option(PCMK__ENV_NODE_START_STATE, "standby", false); return TRUE; } @@ -129,7 +129,7 @@ pcmk_sigquit(int nsig) } static void -mcp_chown(const char *path, uid_t uid, gid_t gid) +pacemakerd_chown(const char *path, uid_t uid, gid_t gid) { int rc = chown(path, uid, gid); @@ -166,7 +166,7 @@ create_pcmk_dirs(void) crm_warn("Could not create directory " CRM_STATE_DIR ": %s", pcmk_rc_str(errno)); } else { - mcp_chown(CRM_STATE_DIR, pcmk_uid, pcmk_gid); + pacemakerd_chown(CRM_STATE_DIR, pcmk_uid, pcmk_gid); } for (int i = 0; dirs[i] != NULL; ++i) { @@ -176,7 +176,7 @@ create_pcmk_dirs(void) crm_warn("Could not create directory %s: %s", dirs[i], pcmk_rc_str(rc)); } else { - mcp_chown(dirs[i], pcmk_uid, pcmk_gid); + pacemakerd_chown(dirs[i], pcmk_uid, pcmk_gid); } } } @@ -312,7 +312,8 @@ main(int argc, char **argv) goto done; } - pcmk__set_env_option("mcp", "true"); + // @COMPAT Drop at 3.0.0; likely last used in 1.1.24 + pcmk__set_env_option(PCMK__ENV_MCP, "true", true); if (options.shutdown) { pcmk__cli_init_logging("pacemakerd", args->verbosity); @@ -330,7 +331,11 @@ main(int argc, char **argv) } pcmk_register_ipc_callback(old_instance, pacemakerd_event_cb, NULL); - rc = pcmk_connect_ipc(old_instance, pcmk_ipc_dispatch_sync); + rc = pcmk__connect_ipc(old_instance, pcmk_ipc_dispatch_sync, 2); + if (rc != pcmk_rc_ok) { + crm_debug("No existing %s instance found: %s", + pcmk_ipc_name(old_instance, true), pcmk_rc_str(rc)); + } old_instance_connected = pcmk_ipc_is_connected(old_instance); if (options.shutdown) { @@ -388,7 +393,7 @@ main(int argc, char **argv) } #ifdef SUPPORT_COROSYNC - if (mcp_read_config() == FALSE) { + if (pacemakerd_read_config() == FALSE) { crm_exit(CRM_EX_UNAVAILABLE); } #endif @@ -399,7 +404,7 @@ main(int argc, char **argv) if (!pcmk__str_eq(facility, PCMK__VALUE_NONE, pcmk__str_casei|pcmk__str_null_matches)) { - setenv("HA_LOGFACILITY", facility, 1); + pcmk__set_env_option("LOGFACILITY", facility, true); } } @@ -409,7 +414,7 @@ main(int argc, char **argv) remove_core_file_limit(); create_pcmk_dirs(); - pcmk__serve_pacemakerd_ipc(&ipcs, &mcp_ipc_callbacks); + pcmk__serve_pacemakerd_ipc(&ipcs, &pacemakerd_ipc_callbacks); #ifdef SUPPORT_COROSYNC /* Allows us to block shutdown */ @@ -420,10 +425,7 @@ main(int argc, char **argv) #endif if (pcmk__locate_sbd() > 0) { - setenv("PCMK_watchdog", "true", 1); running_with_sbd = TRUE; - } else { - setenv("PCMK_watchdog", "false", 1); } switch (find_and_track_existing_processes()) { |