[osiris] Re: error in print-db

David Vasil dmvasil at ornl.gov
Fri May 26 11:00:02 EDT 2006


Michael Menge wrote:
> Hi,
> 
> print-db my_host 42
> shows he following error "!! error: no host specified."
> 
> If I say
> 
> host my_host
> print-db 42
> 
> all ist fine, but if my_host is not running
> 
> host my_host
> 
> returns "!! error: unable to connect to host"
> 
> So I can't print the DB if the host is down
> 
> 
> I am using Osiris 4.2.0

Yeah, in src/cli/osiris.c the COMMAND_PRINT_DB only takes 1 argument.  I
have modified it to take either a "hostname db-number" or just
"db-number" as the arguments.  I havent had time to test this (it does
compile though), and have no idea if it will work, but you can try it if
you like.  I wont have time to test it until next week as I'll be out of
town.

--- osiris.c	2006-01-05 14:29:09.000000000 -0500
+++ osiris.c.patched	2006-05-26 10:42:30.000000000 -0400
@@ -1048,7 +1048,6 @@
             case COMMAND_REMOVE_DB:
             case COMMAND_EDIT_CONFIG:
             case COMMAND_PRINT_CONFIG:
-            case COMMAND_PRINT_DB:
             case COMMAND_PRINT_DB_ERRORS:
             case COMMAND_PRINT_DB_HEADER:
             case COMMAND_PRINT_LOG:
@@ -1062,6 +1061,24 @@
                 }

                 break;
+            case COMMAND_PRINT_DB:
+		
+                if( strlen( name2 ) > 0 && strlen( name ) > 0 )
+                {
+                    osi_strlcpy( ctl_context.buffer, name2,
+                                 sizeof( ctl_context.buffer ) );
+
+                    osi_strlcpy( ctl_context.host, name,
+	                          sizeof( ctl_context.host ) );
+                }
+
+		else if( strlen ( name ) > 0 )
+                {
+                    osi_strlcpy( ctl_context.buffer, name,
+                                 sizeof( ctl_context.buffer ) );
+                }
+
+                break;

             case COMMAND_NEW_CONFIG:


-- 
| David Vasil <dmvasil at ornl.gov>
| Oak Ridge National Laboratory NCCS Division



More information about the osiris mailing list