User Tools

Site Tools


server:running_the_server:signals

This is an old revision of the document!


Kill Signals

The crossfire main binary server handles several signals sent to it :

  1. 1 SIGHUP
  2. 2 SIGINT
  3. 3 SIGQUT
  4. 7 SIGBUS
  5. 11 SIGSEGV
  6. 13 SIGPIPE
  7. 15 SIGTERM

1 Hang Up [SIG]HUP

This signal forces the crossfire server unfortunately not to reload the configuration files, but should write a new log file, if the logging output is not send to stderr ( of some terminal ) .

Syntax : kill -1 `pidof crossfire-server`

2 Interrupt [SIG}INT

This signal actually shutdowns the crossfire server, with leaving a message about it in the logfile, having received that signal. Calls fatal_signal(0, 1) .

Syntax : kill -2 `ps -o pid,args | grep -e 'crossfire-server' | grep -v 'grep' | awk '{print $1}'`
Of course, pidof is much easier to use … :-)

3 Quit [SIG]QUIT

Writes log at level info and calls fatal_signal(1, 1) .

7 [SIG]BUS

Only handled if #ifdef SIGBUS was defined at server compiling time; writes to log level error and calls fatal_signal(1, 1)

11 Segmentation Fault [SIG]SEGV

Should write to log level error and calls fatal_signal(1, 1) .

13 [SIG]PIPE

On Windows OS writes at log level error and calls fatal_signal(1, 1), on other Operating Systems writes at log level info and is otherwise ignored.

15 Termination [SIG]TERM

Writes at log level info and calls fatal_signal(0, 1) .

Technical

The file that contains the signal handling code is server/server/init.c
Functions are named rec_sigNAME like

void rec_sigint(int i) {
  LOG(llevInfo,"\nSIGINT received.\n");
  fatal_signal(0, 1);
}

Except for rec_sighup , these functions all call the function fatal_signal with the parameters to make_core and close_sockets .

void fatal_signal(int make_core, int close_sockets) {
  if(init_done) {
    emergency_save(0);
    clean_tmp_files();
  }
  if(make_core)
    abort();
  exit(0);
}
server/running_the_server/signals.1519828465.txt.gz · Last modified: 2018/02/28 08:34 by karl