Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, for more info) to build successfully.

Commit bd78d5c5 authored by Rob Swindell's avatar Rob Swindell 💬

Add timestamp of node.log file to crash.log

When a preexisting node.log file is found, a terminal server crash is suspected. Include the timestamp of the node.log in the message appended to the system log (data/logs/*.log) to help identify the likely time of the crash.
parent f9fa33e0
Pipeline #632 passed with stage
in 9 minutes and 38 seconds
...@@ -3490,6 +3490,7 @@ bool sbbs_t::init() ...@@ -3490,6 +3490,7 @@ bool sbbs_t::init()
{ {
char str[MAX_PATH+1]; char str[MAX_PATH+1];
char tmp[128]; char tmp[128];
char tmp2[128];
int result; int result;
uint i,j,k,l; uint i,j,k,l;
node_t node; node_t node;
...@@ -3592,11 +3593,13 @@ bool sbbs_t::init() ...@@ -3592,11 +3593,13 @@ bool sbbs_t::init()
now=time(NULL); now=time(NULL);
struct tm tm; struct tm tm;
localtime_r(&now,&tm); localtime_r(&now,&tm);
time_t ftime = fdate(str);
safe_snprintf(str,sizeof(str),"%s %s %s %02d %u " safe_snprintf(str,sizeof(str),"%s %s %s %02d %u "
"End of preexisting log entry (possible crash)" "End of preexisting log entry (possible crash on %.24s)"
,hhmmtostr(&cfg,&tm,tmp) ,hhmmtostr(&cfg,&tm,tmp)
,wday[tm.tm_wday] ,wday[tm.tm_wday]
,mon[tm.tm_mon],tm.tm_mday,tm.tm_year+1900); ,mon[tm.tm_mon],tm.tm_mday,tm.tm_year+1900
,ctime_r(&ftime, tmp2));
logline(LOG_NOTICE,"L!",str); logline(LOG_NOTICE,"L!",str);
log(crlf); log(crlf);
catsyslog(TRUE); catsyslog(TRUE);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment