]>
Commit | Line | Data |
---|---|---|
3bd189cb JR |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> |
2 | <HTML> | |
3 | <HEAD> | |
4 | <TITLE> [IRCServices] Turning over logs with crontab? | |
5 | </TITLE> | |
6 | <LINK REL="Index" HREF="index.html" > | |
7 | <LINK REL="made" HREF="mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20Turning%20over%20logs%20with%20crontab%3F&In-Reply-To=003201c02e15%24154c80a0%2435c48e8b%40darktech.org"> | |
8 | <META NAME="robots" CONTENT="index,nofollow"> | |
9 | <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> | |
10 | <LINK REL="Previous" HREF="000798.html"> | |
11 | <LINK REL="Next" HREF="000800.html"> | |
12 | </HEAD> | |
13 | <BODY BGCOLOR="#ffffff"> | |
14 | <H1>[IRCServices] Turning over logs with crontab?</H1> | |
15 | <B>Chris Wiest</B> | |
16 | <A HREF="mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20Turning%20over%20logs%20with%20crontab%3F&In-Reply-To=003201c02e15%24154c80a0%2435c48e8b%40darktech.org" | |
17 | TITLE="[IRCServices] Turning over logs with crontab?">kwahraw at relic.net | |
18 | </A><BR> | |
19 | <I>Wed Oct 4 11:09:46 PDT 2000</I> | |
20 | <P><UL> | |
21 | <LI>Previous message: <A HREF="000798.html">[IRCServices] Turning over logs with crontab? | |
22 | </A></li> | |
23 | <LI>Next message: <A HREF="000800.html">[IRCServices] Mailing List Downtime | |
24 | </A></li> | |
25 | <LI> <B>Messages sorted by:</B> | |
26 | <a href="date.html#799">[ date ]</a> | |
27 | <a href="thread.html#799">[ thread ]</a> | |
28 | <a href="subject.html#799">[ subject ]</a> | |
29 | <a href="author.html#799">[ author ]</a> | |
30 | </LI> | |
31 | </UL> | |
32 | <HR> | |
33 | <!--beginarticle--> | |
34 | <PRE>This was a "hack" for me, however I modified services so that if they are | |
35 | sent a kill -HUP, they: rotate the logs, reload their configuration files, | |
36 | as well as send a global notice (GNOTICE) that they've received a SIGHUP | |
37 | signal. I also did a hack to the operserv.c, and extern.h so that a /msg | |
38 | operserv restart will properly restart (tagging that comand as the | |
39 | variable sigrestart) | |
40 | ||
41 | The code is below, some got chopped, but you should get the jist (from | |
42 | main.c) | |
43 | ||
44 | if(!sigrestart) | |
45 | { | |
46 | save_data = 1; | |
47 | /* signal(SIGHUP, SIG_IGN); */ | |
48 | log("Received SIGHUP, rehashing."); | |
49 | send_cmd(NULL, "GNOTICE :signal ^BSIGHUP^B received, reinitializing | |
50 | services log file$ | |
51 | rotate_log(NULL); | |
52 | read_config(); | |
53 | numcnt = 0; | |
54 | return; | |
55 | } | |
56 | else { | |
57 | save_data = -2; | |
58 | signal(SIGHUP, SIG_IGN); | |
59 | log("Received SIGHUP, restarting."); | |
60 | if (!quitmsg) | |
61 | ||
62 | ||
63 | etc.. | |
64 | ||
65 | I then have a standard ircd type crontab running the kill -HUP command on | |
66 | the services pid daily, if you need more help, let me know. | |
67 | ||
68 | --Chris | |
69 | ||
70 | On Wed, 4 Oct 2000, Tim AtLee wrote: | |
71 | ||
72 | ><i> Hi there | |
73 | </I>><i> | |
74 | </I>><i> I was wondering if services had a command-line thingey to rotate logs (same | |
75 | </I>><i> as /msg operserv rotatelog). | |
76 | </I>><i> | |
77 | </I>><i> Thanks, | |
78 | </I>><i> | |
79 | </I>><i> Tim | |
80 | </I>><i> | |
81 | </I>><i> | |
82 | </I>><i> | |
83 | </I>><i> --------------------------------------------------------------- | |
84 | </I>><i> To unsubscribe, send email to <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">majordomo at ender.shadowfire.org</A> | |
85 | </I>><i> with "unsubscribe ircservices" in the body, without the quotes. | |
86 | </I>><i> | |
87 | </I> | |
88 | ||
89 | --------------------------------------------------------------- | |
90 | To unsubscribe, send email to <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">majordomo at ender.shadowfire.org</A> | |
91 | with "unsubscribe ircservices" in the body, without the quotes. | |
92 | ||
93 | ||
94 | </PRE> | |
95 | ||
96 | <!--endarticle--> | |
97 | <HR> | |
98 | <P><UL> | |
99 | <!--threads--> | |
100 | <LI>Previous message: <A HREF="000798.html">[IRCServices] Turning over logs with crontab? | |
101 | </A></li> | |
102 | <LI>Next message: <A HREF="000800.html">[IRCServices] Mailing List Downtime | |
103 | </A></li> | |
104 | <LI> <B>Messages sorted by:</B> | |
105 | <a href="date.html#799">[ date ]</a> | |
106 | <a href="thread.html#799">[ thread ]</a> | |
107 | <a href="subject.html#799">[ subject ]</a> | |
108 | <a href="author.html#799">[ author ]</a> | |
109 | </LI> | |
110 | </UL> | |
111 | ||
112 | </body></html> |