From c09124d6ae9060ea52a6d8bc284140f8ab95fbe9 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 03 May 2007 03:56:41 +0000
Subject: [PATCH] Implement support for config file change detection, which can detect external edits to the server configuration (e.g., manually updating the file in a text editor) with the server online. If the server detects that the configuration file has been externally modified when it needs to rewrite it to apply a change coming in through protocol, then it will attempt to copy the manually-edited file off to the side and will generate an administrative alert and write a log message to let administrators know what happened.
---
opends/src/server/org/opends/server/messages/ConfigMessages.java | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/messages/ConfigMessages.java b/opends/src/server/org/opends/server/messages/ConfigMessages.java
index e856107..94db4da 100644
--- a/opends/src/server/org/opends/server/messages/ConfigMessages.java
+++ b/opends/src/server/org/opends/server/messages/ConfigMessages.java
@@ -6595,6 +6595,32 @@
/**
+ * The message ID for the message that will be used if the server detects that
+ * the configuration has been manually edited while the server is online, but
+ * that the manual edits have been copied off into another file before the
+ * configuration was updated by another change. This takes two arguments,
+ * which are the path to the live configuration file and the path to the file
+ * containing the manual edits.
+ */
+ public static final int MSGID_CONFIG_MANUAL_CHANGES_DETECTED =
+ CATEGORY_MASK_CONFIG | SEVERITY_MASK_SEVERE_WARNING | 655;
+
+
+
+ /**
+ * The message ID for the message that will be used if the server detects that
+ * the configuration may have been manually edited while the server is online,
+ * but a problem occurred that prevented the manual changes from being copied
+ * before the configuration was overwritten. This takes two arguments, which
+ * are the path to the live configuration file and a string representation of
+ * the exception that was caught.
+ */
+ public static final int MSGID_CONFIG_MANUAL_CHANGES_LOST =
+ CATEGORY_MASK_CONFIG | SEVERITY_MASK_SEVERE_ERROR | 656;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -6917,6 +6943,19 @@
registerMessage(MSGID_CONFIG_FILE_CANNOT_WRITE_CONFIG_ARCHIVE,
"An error occurred while trying to write the current " +
"configuration to the configuration archive: %s");
+ registerMessage(MSGID_CONFIG_MANUAL_CHANGES_DETECTED,
+ "The Directory Server has detected that one or more " +
+ "external changes have been made to the configuration " +
+ "file %s while the server was online, but another change " +
+ "has caused the server configuration to be overwritten. " +
+ "The manual changes have not been applied, but they have " +
+ "been preserved in file %s");
+ registerMessage(MSGID_CONFIG_MANUAL_CHANGES_LOST,
+ "The Directory Server encountered an error while " +
+ "attempting to determine whether the configuration file " +
+ "%s has been externally edited with the server online, " +
+ "and/or trying to preserve such changes: %s. Any " +
+ "manual changes made to that file may have been lost");
registerMessage(MSGID_CONFIG_FILE_WRITE_CANNOT_EXPORT_NEW_CONFIG,
"An error occurred while attempting to export the new " +
"Directory Server configuration to file %s: %s");
--
Gitblit v1.10.0