User Tools

Site Tools


server:running_the_server:signals

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

server:running_the_server:signals [2018/02/28 08:34]
karl created
server:running_the_server:signals [2018/03/03 15:03] (current)
karl [1 Hang Up [SIG]HUP] Error: claimed that the logfile would be newly writtene, but is re-opened in append mode.
Line 12: Line 12:
 ==== 1 Hang Up [SIG]HUP ==== ==== 1 Hang Up [SIG]HUP ====
  
-This signal forces the crossfire server unfortunately not +This signal forces the crossfire ​[[:server]] unfortunately not 
-to reload the configuration files, but should write a new log file,+to reload the configuration files, ​\\ 
 +but reopens the log file in append mode,
 if the logging output is not send to stderr ( of some terminal ) . if the logging output is not send to stderr ( of some terminal ) .
  
 Syntax : ''​kill -1 `pidof crossfire-server`''​ Syntax : ''​kill -1 `pidof crossfire-server`''​
 +
 +The whole path to the logfile is defined in //​server/​include/​config.h//​ as absolute path-name :
 +  * Windows : #define LOGFILE "​var\\crossfire.log"​
 +  * #else : #define LOGFILE "/​var/​log/​crossfire/​logfile"​
 +The //​configure//​ script inside the [[:​server:​server_compiling|source]] does not alter that path, even when the //​--prefix//​ option had been applied. \\
 +The server may choke at start up, if the directory //var// or // /​var/​log/​crossfire//​ does not exist, \\ or has not set proper writable permissions.
 +
 +The source code file //​server/​common.logger.c//​ opens the existing logfile \\ 
 +in append mode inside the function //void LOG (LogLevel logLevel, const char *format, ...)// :
 +<code c>if ((logfile = fopen(settings.logfilename,​ "​a"​)) == NULL)</​code>​
 +"​a"​ means append :
 +>​**a** ​      Open for appending (writing at end of file). ​ The file is
 +>        created if it does not exist. ​ The stream is positioned at the
 +>        end of the file.
 +From manual page [[http://​man7.org/​linux/​man-pages/​man3/​fopen.3.html]]
 +
 +FIXME It makes no sense to append to a logfile; I have a 55 MB logfile and would like the idea, to completely overwrite it, without the need to shut down the server entirely. \\
 +In the case of a long-time running server like the [[:​servers:​metalforge]] one , this log file could crash the Operating System because of it's sheer size ( filling up the partition ).
  
 ==== 2 Interrupt [SIG}INT ==== ==== 2 Interrupt [SIG}INT ====
server/running_the_server/signals.1519828465.txt.gz · Last modified: 2018/02/28 08:34 by karl