Пример программы обработчика событий

#include < stdio.h >
int main(int argc,char **argv)
  {
if(argc< 2  || argc >4)
  printf ("STPROC:  error. argc=%d\n",argc);
  else
    {
    printf("STPROC:  current  SERVER status =%s\n",argv[1]);
    switch (argc)
      {
      case 2:
      break;
      case 3:
      printf("STPROC: process start %s\n", argv[2]);
      break;
      case 4:
      printf("STPROC: process stop %s, exit status = %s\n", argv[2], argv[3]);
     }
    }
   exit(0);
  }