[Pvfs2-cvs] commit by bligon in pvfs2/src/server: pvfs2-server.c

CVS commit program cvs at parl.clemson.edu
Wed May 4 16:04:12 EDT 2011


Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb1:/tmp/cvs-serv30524

Modified Files:
      Tag: Orange-Branch
	pvfs2-server.c 
Log Message:
Added functionality to the SIGHUP feature allowing the debug mask to be reset when SIGHUP signal is received
by the server.  Changes submitted by Bart Taylor from Acxiom.  In addition, the user must now specify a full
path for the pvfs2-fs.conf file when starting the server.  In this way, SIGHUP will always be able to find
the file.


Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.c,v
diff -p -u -r1.269.4.6 -r1.269.4.7
--- pvfs2-server.c	26 Oct 2010 19:17:21 -0000	1.269.4.6
+++ pvfs2-server.c	4 May 2011 20:04:11 -0000	1.269.4.7
@@ -1276,6 +1276,7 @@ static void hup_sighandler(int sig, sigi
 static void reload_config(void)
 {
     struct server_configuration_s sighup_server_config;
+    struct server_configuration_s *orig_server_config;
     PINT_llist *orig_filesystems = NULL;
     PINT_llist *hup_filesystems  = NULL;
     struct filesystem_configuration_s *orig_fs;
@@ -1293,6 +1294,19 @@ static void reload_config(void)
     }
     else /* Successful load of config */
     {
+        /* Get the current server configuration and update global items */
+        orig_server_config = get_server_config_struct();
+        if (orig_server_config->event_logging)
+        {
+            free(orig_server_config->event_logging);
+        }
+        
+        /* Copy the new logging mask into the current server configuration */
+        orig_server_config->event_logging = strdup(sighup_server_config.event_logging);
+        
+        /* Reset the debug mask */
+        gossip_set_debug_mask(1, PVFS_debug_eventlog_to_mask(orig_server_config->event_logging));
+
         orig_filesystems = server_config.file_systems;
         /* Loop and update all stored file systems */
         while(orig_filesystems)
@@ -1769,6 +1783,13 @@ static int server_parse_cmd_line_args(in
     }
 
     fs_conf = argv[optind++];
+    if (fs_conf[0] != '/')
+    {
+        /* force the user to enter a full path for the conf file, so that SIGHUP functionality will */
+        /* always work.                                                                             */
+        gossip_err("Error: Please specify an absolute path for the conf file.\n");
+        goto parse_cmd_line_args_failure;
+    }
 
     if(argc - total_arguments > 2)
     {



More information about the Pvfs2-cvs mailing list