Changeset 10465 in ntrip


Ignore:
Timestamp:
May 2, 2024, 9:41:10 AM (3 months ago)
Author:
stuerze
Message:

a SIGHUP signal to BNC will result into a reload of its configuration file

Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccore.h

    r10097 r10465  
    5252  void              setPortCorr(int port);
    5353  void              setCaster(bncCaster* caster) {_caster = caster;}
    54   const bncCaster*  caster() const {return _caster;}
     54  bncCaster*        caster() {return _caster;}
    5555  bool              dateAndTimeGPSSet() const;
    5656  QDateTime         dateAndTimeGPS() const;
  • trunk/BNC/src/bncmain.cpp

    r10451 r10465  
    6464
    6565void catch_SIGINT(int) {
    66   cout << "Program Interrupted by Ctrl-C" << endl;
     66  cout << "BNC Interrupted by Ctrl-C" << endl;
    6767  BNC_CORE->sigintReceived = 1;
    6868  BNC_CORE->stopPPP();
     
    7676}
    7777
    78 void catch_SIGPIPE(int signum) {
    79   cout << "Caught signal SIGPIPE " << signum << endl;
     78void catch_SIGTERM(int) {
     79  cout << "BNC Terminated" << endl;
     80  BNC_CORE->sigintReceived = 1;
     81  BNC_CORE->stopPPP();
     82  BNC_CORE->stopCombination();
     83#ifndef WIN32
     84  sleep(2);
     85#else
     86  Sleep(2000);
     87#endif
     88  ::exit(0);
     89}
     90
     91void catch_SIGHUP(int) {
     92  cout << "BNC received SIGHUP signal: reload configuration" << endl;
     93  bncSettings settings;
     94  settings.reRead();
     95  BNC_CORE->caster()->readMountPoints();
    8096}
    8197
     
    449465  }
    450466
    451 
    452 
    453 #ifndef WIN32
    454   signal(SIGPIPE, catch_SIGPIPE);
    455 #endif
    456 
    457     // Interactive Mode - open the main window
     467  // Interactive Mode - open the main window
    458468  // -----------------------------------------
    459469  if (interactive) {
     
    512522
    513523    signal(SIGINT, catch_SIGINT);
     524    signal(SIGTERM, catch_SIGTERM);
     525    signal(SIGHUP, catch_SIGHUP);
    514526
    515527    BNC_CORE->sigintReceived = 0;
     
    552564      caster->addGetThread(getThread, true);
    553565    }
     566
    554567  }
    555568
Note: See TracChangeset for help on using the changeset viewer.