Fixed logging, added cvs tags

This commit is contained in:
Michiel Broek 2002-06-05 21:07:36 +00:00
parent 43de18522a
commit bfd74def66
15 changed files with 45 additions and 22 deletions

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbtask/callstat.c
* $Id$
* Purpose ...............: Read mailer last call status
* Last modification date : 08-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,6 +1,8 @@
#ifndef CALLSTAT_H
#define CALLSTAT_H
/* $Id$ */
#define ST_PORTERR 1
#define ST_NOCONN 2

View File

@ -584,12 +584,12 @@ int checktasks(int onsig)
if (first && task[i].rc) {
first = FALSE;
tasklog('t', "Task Type pid stat status rc status");
tasklog('t', "---------------- ------- ----- ---- ----------- ----- --------");
tasklog('t', "Task Type pid stat rc");
tasklog('t', "---------------- ------- ----- ---- -----");
for (j = 0; j < MAXTASKS; j++)
if (strlen(task[j].name))
tasklog('t', "%-16s %s %5d %s %-11d %5d %08x", task[j].name, callmode(task[j].tasktype),
task[j].pid, task[j].running?"runs":"stop", task[j].status, task[j].rc, task[j].status);
tasklog('t', "%-16s %s %5d %s %5d", task[j].name, callmode(task[j].tasktype),
task[j].pid, task[j].running?"runs":"stop", task[j].rc);
}
switch (task[i].rc) {
@ -607,7 +607,6 @@ int checktasks(int onsig)
count++;
break;
default:
tasklog('+', "errno=%d %s", errno, strerror(errno));
if (WIFEXITED(task[i].status)) {
rc = WEXITSTATUS(task[i].status);
if (rc)
@ -652,7 +651,10 @@ void die(int onsig)
int i, count;
signal(onsig, SIG_IGN);
tasklog('+', "Shutting down on signal %s", SigName[onsig]);
if (onsig == SIGTERM)
tasklog('+', "Starting normal shutdown");
else
tasklog('+', "Abnormal shutdown on signal %s", SigName[onsig]);
/*
* First check if there are tasks running, if so try to stop them
@ -681,6 +683,11 @@ void die(int onsig)
}
}
if ((count = checktasks(0)))
tasklog('?', "Shutdown with %d tasks still running", count);
else
tasklog('+', "Good, no more tasks running");
ulocktask();
if (sock != -1)
close(sock);

View File

@ -1,8 +1,9 @@
/* $Id */
#ifndef _MBTASK_H
#define _MBTASK_H
/* $Id$ */
/*
* Defines.
* SLOWRUN is number of seconds for scheduling mailer calls. Leave at 20!

View File

@ -4,7 +4,7 @@
* Purpose ...............: mbtask - Scan mail outbound status
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbtask/scanout.c
* $Id$
* Purpose ...............: Outbound scanning
* Last modification date : 09-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,6 +1,9 @@
#ifndef SCANOUT_H
#define SCANOUT_H
/* $Id$ */
#define OUT_PKT 0
#define OUT_DIR 1
#define OUT_FLO 2

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: signame.c
* $Id$
* Purpose ...............: Signal names
* Last modification date : 24-May-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,6 +1,8 @@
#ifndef _SIGNAME_H
#define _SIGNAME_H
/* $Id$ */
char SigName[32][16];

View File

@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Daemon
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,6 +1,9 @@
#ifndef _TASKCOMM_H
#define _TASKCOMM_H
/* $Id$ */
void do_cmd(char *);
#endif

View File

@ -1,6 +1,9 @@
#ifndef _TASKDISK_H
#define _TASKDISK_H
/* $Id$ */
char *get_diskstat(void); /* Get disk status */

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbtask/taskinfo.c
* $Id$
* Purpose ...............: Give system information
* Last modification date : 26-Oct-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10

View File

@ -1,6 +1,9 @@
#ifndef _TASKINFO_H
#define _TASKINFO_H
/* $Id$ */
char *get_sysinfo(void); /* Get System Info */
char *get_lastcallercount(void); /* Get Lastcallers count */
char *get_lastcallerrec(int); /* Get Lastcaller record */

View File

@ -1,6 +1,9 @@
#ifndef _TASKREGS_H
#define _TASKREGS_H
/* $Id$ */
#define MAXCLIENT 100