Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  5 Mar 98 02:23:50 +0100
From:      David Wetzel <dave@turbocat.de>
To:        hm@hcs.de
Cc:        freebsd-isdn@FreeBSD.ORG
Subject:   HUP and re-reading isdn.rc
Message-ID:  <199803050123.CAA00714@luigi.turbocat.de>

next in thread | raw e-mail | index | archive | help
Hi,

I was trying to teach ISDND to re-read the config-file when you send a HUP to it.

But it seems that configure() does not work as expected.

Sorry, I have to get up early...

---
   _  _
 _(_)(_)_  David Wetzel, Turbocat's Development,
(_) __ (_) Buchhorster Strasse, D-16567 Muehlenbeck/Berlin, FRG,
  _/  \_   Fax +49 33056 82835 NeXTmail dave@turbocat.de
 (______)  http://www.turbocat.de/
           DEVELOPMENT * CONSULTING * ADMINISTRATION
           WATCH OUT FOR TURBOFAX for OPENSTEP!

diff -c main.c.org main.c
*** main.c.org  Sun Feb 22 20:13:53 1998
--- main.c      Thu Mar  5 01:59:53 1998
***************
*** 54,59 ****
--- 54,86 ----
  static void kbdrdhdl(void);
  static void isdnrdhdl(void);

+ // Thu Mar  5 01:53:18 MET 1998       dave@turbocat.de
+ /*---------------------------------------------------------------------------*
+  *    re-reads the configuration
+  *---------------------------------------------------------------------------*/
+ void
+ do_reconfig(int exitval)
+ {
+
+       log(LL_DMN, "Got HUP signal, re-reading configfile");
+
+       if(do_fullscreen)
+               endwin();
+
+       configure(configfile);
+
+       if(config_error_flag)
+       {
+               log(LL_ERR, "there were %d error(s) in the configuration  
file, terminating!", config_error_flag);
+               close_allactive();
+
+               unlink(PIDFILE);
+
+               exit(1);
+       }
+
+ }
+
  /*---------------------------------------------------------------------------*
   *    program entry
   *---------------------------------------------------------------------------*/
***************
*** 176,181 ****
--- 203,210 ----
        signal(SIGINT, do_exit);
        signal(SIGTERM, do_exit);

+       signal(SIGHUP, do_reconfig);
+
        /* open isdn device */

        if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0)
***************
*** 285,290 ****
--- 314,320 ----
        do_exit(0);
        return(0);
  }
+

  /*---------------------------------------------------------------------------*
   *    program exit

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803050123.CAA00714>