[openib-general] progress...but opensm crashed

Hal Rosenstock halr at voltaire.com
Mon Jan 3 13:03:22 PST 2005


On Mon, 2005-01-03 at 14:48, Tom Duffy wrote:
> It would be cool if the log file was saved with the pid in the name as
> well since then it wouldn't delete the old one when you restarted the
> sm.

Dealing with the too many log files (and space) issue is probably better
than deleting the old log file (and making that explicit). So if no one
has any objections to this, I will commit the change for this. It is
pretty simple.

-- Hal

Index: osm/opensm/osm_subnet.c
===================================================================
--- osm/opensm/osm_subnet.c	(revision 1456)
+++ osm/opensm/osm_subnet.c	(working copy)
@@ -94,6 +94,8 @@
 #include "osm_multicast.h"
 #include "osm_inform.h"
 
+static char log_file[64];
+
 /**********************************************************************
  **********************************************************************/
 void
@@ -433,7 +435,8 @@
   p_opt->polling_retry_number = 4;
   p_opt->force_heavy_sweep = FALSE;
   p_opt->log_flags = 0;
-  p_opt->log_file = "/tmp/osm.log";
+  sprintf(&log_file, "/tmp/osm.%d.log", getpid());
+  p_opt->log_file = &log_file;
   p_opt->port_profile_switch_nodes = FALSE;
   p_opt->max_port_profile = 0xffffffff;
   p_opt->pfn_ui_pre_lid_assign = NULL;
Index: osm/opensm/main.c
===================================================================
--- osm/opensm/main.c	(revision 1456)
+++ osm/opensm/main.c	(working copy)
@@ -199,7 +199,7 @@
   printf( "-f\n"
           "--log_file\n"
           "          This option defines the log to be the given file.\n"
-          "          By default the log goes to /tmp/osm.log.\n"
+          "          By default the log goes to /tmp/osm.PID.log.\n"
           "          For the log to go to standard output use -f stdout.\n\n");
   printf( "-v\n"
           "--verbose\n"






More information about the general mailing list