]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2004-04-05 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Tue, 5 Apr 2005 00:45:23 +0000 (00:45 +0000)
committerpaul <paul>
Tue, 5 Apr 2005 00:45:23 +0000 (00:45 +0000)
* lib/vty.c: Improve logging of failures to open vty socket(s).
  See bugid #163.
* zebra/zserv.c: print more helpful errors when we fail to successfully
  bind and listen on zserv socket. Closes bugzilla #163.

lib/ChangeLog
lib/vty.c
zebra/ChangeLog
zebra/zserv.c

index 6701a90de63b568f80de7b1ba632cb4ebe6d4171..57bb3d1cec37ce62bc9923e33b6e693762268de9 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-05 Paul Jakma <paul@dishone.st>
+
+       * vty.c: Improve logging of failures to open vty socket(s).
+         See bugid #163.
+
 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * if.h: Fix comments to reflect that if_lookup_by_name and
index eca1523cdc8d9fd5e2835d66182a2e0a8d15ad71..44439a94d71f36d52f94382d6f6fed1536d40153 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2297,13 +2297,16 @@ vty_read_config (char *config_file,
 
       if (confp == NULL)
         {
+          fprintf (stderr, "%s: failed to open configuration file %s: %s\n",
+                   __func__, fullpath, safe_strerror (errno));
+          
           confp = vty_use_backup_config (fullpath);
           if (confp)
             fprintf (stderr, "WARNING: using backup configuration file!\n");
           else
             {
               fprintf (stderr, "can't open configuration file [%s]\n", 
-                   config_file);
+                      config_file);
               exit(1);
             }
         }
@@ -2339,6 +2342,9 @@ vty_read_config (char *config_file,
       confp = fopen (config_default_dir, "r");
       if (confp == NULL)
         {
+          fprintf (stderr, "%s: failed to open configuration file %s: %s\n",
+                   __func__, config_default_dir, safe_strerror (errno));
+          
           confp = vty_use_backup_config (config_default_dir);
           if (confp)
             {
@@ -2350,7 +2356,7 @@ vty_read_config (char *config_file,
               fprintf (stderr, "can't open configuration file [%s]\n",
                                 config_default_dir);
                  exit (1);
-               }
+            }
         }      
       else
         fullpath = config_default_dir;
index 1d0f1754893d8de69fb211e69d59a4fdcf29b973..55e290c0dce8ac0f4d08bb950119e5566e2fc0ef 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-05 Paul Jakma <paul@dishone.st>
+
+       * zserv.c: print more helpful errors when we fail to successfully
+         bind and listen on zserv socket. Closes bugzilla #163.
+
 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * if_ioctl.c: (interface_list_ioctl) Use if_get_by_name_len.
index caebe490a55dbf09a139f4cd02b19493682f62db..a34e214af7d4a786187fb8e68e4218afe20df42c 100644 (file)
@@ -1360,7 +1360,8 @@ zebra_serv ()
 
   if (accept_sock < 0) 
     {
-      zlog_warn ("Can't bind to socket: %s", safe_strerror (errno));
+      zlog_warn ("Can't create zserv stream socket: %s", 
+                 safe_strerror (errno));
       zlog_warn ("zebra can't provice full functionality due to above error");
       return;
     }
@@ -1383,7 +1384,8 @@ zebra_serv ()
               sizeof (struct sockaddr_in));
   if (ret < 0)
     {
-      zlog_warn ("Can't bind to socket: %s", safe_strerror (errno));
+      zlog_warn ("Can't bind to stream socket: %s", 
+                 safe_strerror (errno));
       zlog_warn ("zebra can't provice full functionality due to above error");
       close (accept_sock);      /* Avoid sd leak. */
       return;
@@ -1395,7 +1397,8 @@ zebra_serv ()
   ret = listen (accept_sock, 1);
   if (ret < 0)
     {
-      zlog_warn ("Can't listen to socket: %s", safe_strerror (errno));
+      zlog_warn ("Can't listen to stream socket: %s", 
+                 safe_strerror (errno));
       zlog_warn ("zebra can't provice full functionality due to above error");
       close (accept_sock);     /* Avoid sd leak. */
       return;
@@ -1427,7 +1430,9 @@ zebra_serv_un (const char *path)
   sock = socket (AF_UNIX, SOCK_STREAM, 0);
   if (sock < 0)
     {
-      perror ("sock");
+      zlog_warn ("Can't create zserv unix socket: %s", 
+                 safe_strerror (errno));
+      zlog_warn ("zebra can't provide full functionality due to above error");
       return;
     }
 
@@ -1444,7 +1449,9 @@ zebra_serv_un (const char *path)
   ret = bind (sock, (struct sockaddr *) &serv, len);
   if (ret < 0)
     {
-      perror ("bind");
+      zlog_warn ("Can't bind to unix socket %s: %s", 
+                 path, safe_strerror (errno));
+      zlog_warn ("zebra can't provide full functionality due to above error");
       close (sock);
       return;
     }
@@ -1452,7 +1459,9 @@ zebra_serv_un (const char *path)
   ret = listen (sock, 5);
   if (ret < 0)
     {
-      perror ("listen");
+      zlog_warn ("Can't listen to unix socket %s: %s", 
+                 path, safe_strerror (errno));
+      zlog_warn ("zebra can't provide full functionality due to above error");
       close (sock);
       return;
     }