]> jfr.im git - irc.git/blob - software/RELEASES/ircservices/achurch.org/services/lists/ircservices/2001/001188.html
rename -> *.git
[irc.git] / software / RELEASES / ircservices / achurch.org / services / lists / ircservices / 2001 / 001188.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> AW: AW: [IRCServices] Backup Feature?
5 </TITLE>
6 <LINK REL="Index" HREF="index.html" >
7 <LINK REL="made" HREF="mailto:ircservices%40ircservices.za.net?Subject=AW%3A%20AW%3A%20%5BIRCServices%5D%20Backup%20Feature%3F&In-Reply-To=003201c084ae%24bd564f20%240200000a%40strider">
8 <META NAME="robots" CONTENT="index,nofollow">
9 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
10 <LINK REL="Previous" HREF="001187.html">
11 <LINK REL="Next" HREF="001163.html">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>AW: AW: [IRCServices] Backup Feature?</H1>
15 <B>Ian R. Justman</B>
16 <A HREF="mailto:ircservices%40ircservices.za.net?Subject=AW%3A%20AW%3A%20%5BIRCServices%5D%20Backup%20Feature%3F&In-Reply-To=003201c084ae%24bd564f20%240200000a%40strider"
17 TITLE="AW: AW: [IRCServices] Backup Feature?">ianj at esper.net
18 </A><BR>
19 <I>Thu Jan 25 00:30:31 PST 2001</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="001187.html">AW: AW: [IRCServices] Backup Feature?
22 </A></li>
23 <LI>Next message: <A HREF="001163.html">[IRCServices] Email forwarding
24 </A></li>
25 <LI> <B>Messages sorted by:</B>
26 <a href="date.html#1188">[ date ]</a>
27 <a href="thread.html#1188">[ thread ]</a>
28 <a href="subject.html#1188">[ subject ]</a>
29 <a href="author.html#1188">[ author ]</a>
30 </LI>
31 </UL>
32 <HR>
33 <!--beginarticle-->
34 <PRE>On Mon, 22 Jan 2001, Strider wrote:
35
36 &gt;<i> I think the cron job idea is the best I've seen out of all of this. It uses
37 </I>&gt;<i> the least amount of resources, has less overhead, and no database issues. A
38 </I>&gt;<i> cron job that runs every 5 minutes would work great for that. All you would
39 </I>&gt;<i> have to do is write a script that checks to see if services is running, and
40 </I>&gt;<i> if it finds it isn't, start them up.
41 </I>
42 This is what I have running on the EsperNet :
43
44 ========== 8&lt; ============ Snipperoonie ==============
45
46 #!/usr/bin/perl
47
48 $pidfile = &quot;$ENV{HOME}/lib/services.pid&quot;;
49 $services = &quot;$ENV{HOME}/bin/services&quot;;
50
51 if ( ! -e &quot;$pidfile&quot; ) {
52 system(&quot;$services&quot;);
53 exit;
54 } else {
55 $pid = `cat $pidfile`;
56 chomp $pid;
57 if ( ! -e &quot;/proc/$pid&quot; ) {
58 system(&quot;rm $pidfile&quot;);
59 system(&quot;$services&quot;);
60 exit;
61 }
62 # If we got this far, assume that Services are running correctly,
63 # then exit.
64 }
65
66 ========== 8&lt; ============ Snipperoonie ==============
67
68 Then season to taste.
69
70 On EsperNet, Services runs under its own UID and out of its own home
71 directory. As-is (except for the values of $pidfile and $services, which
72 are site-specific, especially if you are not running this out of a &quot;home
73 directory&quot;), this should work just fine under Linux, FreeBSD, and perhaps
74 OpenBSD. NetBSD uses /kern, if memory serves. Otherwise, as always,
75 YMMV.
76
77 Hell, you could even run this every minute if you so chose since all it
78 really does is check for the presence of one &quot;file&quot; named with the
79 contents of another (assuming THAT file exists, then restarting Services
80 if not or if the one in /proc does not exist).
81
82 The only real sacrifice you might make here is the memory footprint of the
83 Perl interpreter when it starts. I just found it annoyingly easy (and
84 enjoyable) to implement in Perl. :)
85
86 &gt;<i> One feature I'd like to see though that the cron job idea could benefit from
87 </I>&gt;<i> is being able to send the process arguments and it work to where you can
88 </I>&gt;<i> send a global from outside of the ircd. I could see this being useful for
89 </I>&gt;<i> the script to send a global to all users with a warning to identify to
90 </I>&gt;<i> nickserv and an apology about services being down. I could see other
91 </I>&gt;<i> benefits from this as well later on down the line in conjuction with logs
92 </I>&gt;<i> and tail -f if one didn't care to log into irc.
93 </I>
94 You could probably hack in @ARGV support or put in a file that the script
95 would then &quot;include&quot; or &quot;require&quot; into the code, passing those values to
96 Services when you fire up. Or whichever method you'd prefer.
97
98 Perl rocks my world, what more can I say? :)
99
100 --Ian R. Justman, Co-Founder and Postmaster, The EsperNet IRC Network.
101
102 -----
103 Ian R. Justman (NIC handle IJ12) <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">ianj at esper.net</A> (Official EsperNet business)
104 Co-Founder and Postmaster, The EsperNet IRC Network
105 Server Administrator, chocobo.esper.net &quot;IJ&quot; on IRC
106
107 PGP key available upon request, or finger <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">ianj at esper.net.</A>
108
109 If this message was signed with the Postmaster's key, please finger
110 <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">postmaster at esper.net</A> for the Postmaster public key.
111
112 Type Bits/KeyID Date User ID
113 pub 1024/BAB34B69 1997/11/15 EsperNet Postmaster &lt;<A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">postmaster at esper.net</A>&gt;
114 Key fingerprint = 05 BD 7C B5 8E 0B FD EF EE 47 49 C4 96 11 59 75
115
116
117
118 </PRE>
119
120 <!--endarticle-->
121 <HR>
122 <P><UL>
123 <!--threads-->
124 <LI>Previous message: <A HREF="001187.html">AW: AW: [IRCServices] Backup Feature?
125 </A></li>
126 <LI>Next message: <A HREF="001163.html">[IRCServices] Email forwarding
127 </A></li>
128 <LI> <B>Messages sorted by:</B>
129 <a href="date.html#1188">[ date ]</a>
130 <a href="thread.html#1188">[ thread ]</a>
131 <a href="subject.html#1188">[ subject ]</a>
132 <a href="author.html#1188">[ author ]</a>
133 </LI>
134 </UL>
135
136 </body></html>