allow-new-bosconfig-file-and-rename-into-place-20010129
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Mon, 29 Jan 2001 17:40:14 +0000 (17:40 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 29 Jan 2001 17:40:14 +0000 (17:40 +0000)
This patch causes the bosserver to use a "BosConfig.new" file if one is
found on startup, which will allow admins to prepare a new BosConfig
file to be picked up at rebozo time. (This is not possible now because
the bosserver likes overwriting the BosConfig file while it's running)

src/bozo/bosserver.c
src/util/dirpath.c
src/util/dirpath.h

index cd00c2b..27ff7c4 100644 (file)
@@ -233,6 +233,14 @@ char *aname; {
            if (code < 0)
                perror("bosconfig rename");
        }
+#ifdef BOS_NEW_CONFIG
+       if (access(AFSDIR_SERVER_BOZCONFNEW_FILEPATH, 0) == 0) {
+            code = renamefile(AFSDIR_SERVER_BOZCONFNEW_FILEPATH,
+                              AFSDIR_SERVER_BOZCONF_FILEPATH);
+            if (code < 0)
+                 perror("bosconfig rename");
+       }
+#endif       
     }
 
     /* setup default times we want to do restarts */
index e5a3153..ac4d39b 100644 (file)
@@ -266,6 +266,9 @@ static void initDirPathArray(void)
   pathp = dirPathArray[AFSDIR_SERVER_BOZCONF_FILEPATH_ID];
   AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_LOCAL_DIR, AFSDIR_BOZCONF_FILE);
 
+  pathp = dirPathArray[AFSDIR_SERVER_BOZCONFNEW_FILEPATH_ID];
+  AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_LOCAL_DIR, AFSDIR_BOZCONFNEW_FILE);
+
   pathp = dirPathArray[AFSDIR_SERVER_BOZLOG_FILEPATH_ID];
   AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_LOGS_DIR, AFSDIR_BOZLOG_FILE);
 
index e7994c7..e21c0a6 100644 (file)
@@ -124,6 +124,7 @@ ConstructLocalLogPath(const char *cpath,
 #define AFSDIR_SALVAGER_FILE    "salvager"
 #define AFSDIR_SLVGLOCK_FILE    "salvage.lock"
 #define AFSDIR_BOZCONF_FILE     "BosConfig"
+#define AFSDIR_BOZCONFNEW_FILE  "BosConfig.new"
 #define AFSDIR_BOZINIT_FILE     "BozoInit"
 #define AFSDIR_BOZLOG_FILE      "BosLog"
 #define AFSDIR_BOSVR_FILE       "bosserver"
@@ -228,6 +229,7 @@ typedef enum afsdir_id {
       AFSDIR_CLIENT_NETRESTRICT_FILEPATH_ID,
       AFSDIR_SERVER_NETINFO_FILEPATH_ID,
       AFSDIR_SERVER_NETRESTRICT_FILEPATH_ID,
+      AFSDIR_SERVER_BOZCONFNEW_FILEPATH_ID,
       AFSDIR_PATHSTRING_MAX } afsdir_id_t;
 
 /* getDirPath() returns a pointer to a string from an internal array of path strings 
@@ -272,6 +274,7 @@ const char *getDirPath(afsdir_id_t string_id);
 #define AFSDIR_SERVER_SLVGLOG_FILEPATH getDirPath(AFSDIR_SERVER_SLVGLOG_FILEPATH_ID)
 #define AFSDIR_SERVER_SALVAGER_FILEPATH getDirPath(AFSDIR_SERVER_SALVAGER_FILEPATH_ID)
 #define AFSDIR_SERVER_BOZCONF_FILEPATH getDirPath(AFSDIR_SERVER_BOZCONF_FILEPATH_ID)
+#define AFSDIR_SERVER_BOZCONFNEW_FILEPATH getDirPath(AFSDIR_SERVER_BOZCONFNEW_FILEPATH_ID)
 #define AFSDIR_SERVER_BOZINIT_FILEPATH getDirPath(AFSDIR_SERVER_BOZINIT_FILEPATH_ID)
 #define AFSDIR_SERVER_BOZLOG_FILEPATH getDirPath(AFSDIR_SERVER_BOZLOG_FILEPATH_ID)
 #define AFSDIR_SERVER_BOSVR_FILEPATH getDirPath(AFSDIR_SERVER_BOSVR_FILEPATH_ID)