[IRCServices] Turning over logs with crontab?

Chris Wiest kwahraw at relic.net
Wed Oct 4 11:09:46 PDT 2000


This was a "hack" for me, however I modified services so that if they are
sent a kill -HUP, they: rotate the logs, reload their configuration files,
as well as send a global notice (GNOTICE) that they've received a SIGHUP
signal. I also did a hack to the operserv.c, and extern.h so that a /msg
operserv restart will properly restart (tagging that comand as the
variable sigrestart)

The code is below, some got chopped, but you should get the jist (from
main.c)

if(!sigrestart)
{
            save_data = 1;
/*          signal(SIGHUP, SIG_IGN); */
            log("Received SIGHUP, rehashing.");
send_cmd(NULL, "GNOTICE :signal ^BSIGHUP^B received, reinitializing
services log file$
rotate_log(NULL);
read_config();
numcnt = 0;
return;
}
else {
save_data = -2;
signal(SIGHUP, SIG_IGN);
log("Received SIGHUP, restarting.");
if (!quitmsg)


etc..

I then have a standard ircd type crontab running the kill -HUP command on
the services pid daily, if you need more help, let me know.

--Chris

On Wed, 4 Oct 2000, Tim AtLee wrote:

> Hi there
> 
> I was wondering if services had a command-line thingey to rotate logs (same
> as /msg operserv rotatelog).
> 
> Thanks,
> 
> Tim
> 
> 
> 
> ---------------------------------------------------------------
> To unsubscribe, send email to majordomo at ender.shadowfire.org
> with "unsubscribe ircservices" in the body, without the quotes.
> 


---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.