gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] availability of gnunet/patrol


From: Jan Marco Alkema
Subject: [GNUnet-developers] availability of gnunet/patrol
Date: Mon, 10 Mar 2003 18:22:45 -0800

Hello Christian,

>ps2. during my ~5 day absence, gnunetd crashed 21
times. ;)

I have got an idea with the "gdb ./gnunetd" concept in relation to the "BMC
patrol concept".

I run gnunetd in gdb mode. If an exception (segmentation error, etc) occurs
I manually make a gdb trace and send it to "the programmer/maintainer". A
problem is that after an exception occurs the gnunetd process will not
instantly been restarted.

Solution:

Call gdb in another program (fshpatrol). Process the output and input
sequence in that program of "gdb ./gnunetd". If an exception occurs send it
automatically (prefer via port not mail, because receiving smtp (port 25) is
filtered at some ISPs) to the maintainer of the source code. After the trace
are saved in a file or database fshpatrol restart the program instantly.

Maybe can information been send and retrieved to gdb with the "popen"
command. See the appendix for an example of the popen command,

Greetings Jan Marco

void SearchMachine(char *machine, int number_of_retries, unsigned long
record_counter, char *buffer)
{
  FILE *ptr;
  int iii;
  char string[MAX_LENGTH], ch;

  /* sprintf(string, "/usr/bin/host %s", machine);*/

  strcpy(string, "/usr/bin/host ");
  strcatjm(string, machine);

  /* sprintf(string, "/bin/ping -w 3 -c %d %s", number_of_retries,
machine);*/
  printf("%10lu Searchstring=%s=!\n", record_counter, string);
  ptr = popen(string, "r");
  if (!ptr)
    {
      sprintf(string, "Not enough memory to ping:%s!\n", machine);
      reportError(string);
      pclose(ptr);
    }

  iii = 0;
  while ((ch = fgetc(ptr)) != EOF)
    {
      *(buffer+iii) = (ch & 0xFF);
      iii++;
      putchar(ch);
    }
  *(buffer+iii) = ((char) 0);
  pclose(ptr);
}











reply via email to

[Prev in Thread] Current Thread [Next in Thread]