/[smecontribs]/rpms/mailman/contribs7/mailman-cron.patch
ViewVC logotype

Contents of /rpms/mailman/contribs7/mailman-cron.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Apr 21 00:12:42 2008 UTC (16 years, 6 months ago) by slords
Branch: MAIN
CVS Tags: mailman-2_1_5_1-34_rhel4_6_el4_sme
Initial import of mailman-2.1.5.1-34.rhel4.6.el4.sme.src.rpm

1 diff -r -u mailman-2.1.5.orig/cron/bumpdigests mailman-2.1.5/cron/bumpdigests
2 --- mailman-2.1.5.orig/cron/bumpdigests 2002-10-21 18:36:56.000000000 -0400
3 +++ mailman-2.1.5/cron/bumpdigests 2004-09-03 10:41:12.000000000 -0400
4 @@ -1,4 +1,4 @@
5 -#! @PYTHON@
6 +#! @PYTHON@ -S
7 #
8 # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
9 #
10 diff -r -u mailman-2.1.5.orig/cron/checkdbs mailman-2.1.5/cron/checkdbs
11 --- mailman-2.1.5.orig/cron/checkdbs 2003-12-26 17:51:10.000000000 -0500
12 +++ mailman-2.1.5/cron/checkdbs 2004-08-31 12:21:24.000000000 -0400
13 @@ -1,4 +1,4 @@
14 -#! @PYTHON@
15 +#! @PYTHON@ -S
16 #
17 # Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
18 #
19 diff -r -u mailman-2.1.5.orig/cron/crontab.in.in mailman-2.1.5/cron/crontab.in.in
20 --- mailman-2.1.5.orig/cron/crontab.in.in 2002-01-06 01:28:12.000000000 -0500
21 +++ mailman-2.1.5/cron/crontab.in.in 2004-09-02 17:43:27.000000000 -0400
22 @@ -1,24 +1,47 @@
23 +#
24 +# -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING --
25 +# ------------------ EDIT THE CORRECT FILE -------------------------
26 +#
27 +# This file is copied to /etc/cron.d/mailman from
28 +# @prefix@/cron/crontab.in when the mailman service is started via its
29 +# init.d script and the file /etc/cron.d/mailman is removed when the
30 +# service is stopped. Therefore any edits made directly to
31 +# /etc/cron.d/mailman will be lost anytime the mailman service
32 +# restarts.
33 +#
34 +# To make changes edit the master copy @prefix@/cron/crontab.in and then
35 +# restart the service to pick up the changes (/sbin/service mailman restart).
36 +#
37 +# The reason this is done this way is because the mailman cron jobs
38 +# should only be invoked if the mailman service is enabled and not
39 +# just as a consequence of installing the rpm as was the case
40 +# previously. The file /etc/cron.d/mailman cannot simply be linked to
41 +# the master copy in @prefix@/cron because for security reasons cron
42 +# will not process crontab files that are links or writeable by
43 +# anybody else but root, thus the file must be copied into /etc/cron.d
44 +# with the right ownership and permissions.
45 +#
46 # At 8AM every day, mail reminders to admins as to pending requests.
47 # They are less likely to ignore these reminders if they're mailed
48 # early in the morning, but of course, this is local time... ;)
49 -0 8 * * * @PYTHON@ -S @prefix@/cron/checkdbs
50 +0 8 * * * @MAILMAN_USER@ @prefix@/cron/checkdbs
51 #
52 # At 9AM, send notifications to disabled members that are due to be
53 # reminded to re-enable their accounts.
54 -0 9 * * * @PYTHON@ -S @prefix@/cron/disabled
55 +0 9 * * * @MAILMAN_USER@ @prefix@/cron/disabled
56 #
57 # Noon, mail digests for lists that do periodic as well as threshhold delivery.
58 -0 12 * * * @PYTHON@ -S @prefix@/cron/senddigests
59 +0 12 * * * @MAILMAN_USER@ @prefix@/cron/senddigests
60 #
61 # 5 AM on the first of each month, mail out password reminders.
62 -0 5 1 * * @PYTHON@ -S @prefix@/cron/mailpasswds
63 +0 5 1 * * @MAILMAN_USER@ @prefix@/cron/mailpasswds
64 #
65 # Every 5 mins, try to gate news to mail. You can comment this one out
66 # if you don't want to allow gating, or don't have any going on right now,
67 # or want to exclusively use a callback strategy instead of polling.
68 -0,5,10,15,20,25,30,35,40,45,50,55 * * * * @PYTHON@ -S @prefix@/cron/gate_news
69 +0,5,10,15,20,25,30,35,40,45,50,55 * * * * @MAILMAN_USER@ @prefix@/cron/gate_news
70 #
71 # At 3:27am every night, regenerate the gzip'd archive file. Only
72 # turn this on if the internal archiver is used and
73 # GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py
74 -27 3 * * * @PYTHON@ -S @prefix@/cron/nightly_gzip
75 +27 3 * * * @MAILMAN_USER@ @prefix@/cron/nightly_gzip
76 diff -r -u mailman-2.1.5.orig/cron/disabled mailman-2.1.5/cron/disabled
77 --- mailman-2.1.5.orig/cron/disabled 2004-02-10 17:59:45.000000000 -0500
78 +++ mailman-2.1.5/cron/disabled 2004-08-31 12:22:54.000000000 -0400
79 @@ -1,4 +1,4 @@
80 -#! @PYTHON@
81 +#! @PYTHON@ -S
82 #
83 # Copyright (C) 2001-2004 by the Free Software Foundation, Inc.
84 #
85 diff -r -u mailman-2.1.5.orig/cron/gate_news mailman-2.1.5/cron/gate_news
86 --- mailman-2.1.5.orig/cron/gate_news 2003-09-21 22:29:51.000000000 -0400
87 +++ mailman-2.1.5/cron/gate_news 2004-08-31 12:21:48.000000000 -0400
88 @@ -1,4 +1,4 @@
89 -#! @PYTHON@
90 +#! @PYTHON@ -S
91 #
92 # Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
93 #
94 diff -r -u mailman-2.1.5.orig/cron/mailpasswds mailman-2.1.5/cron/mailpasswds
95 --- mailman-2.1.5.orig/cron/mailpasswds 2003-09-21 22:29:51.000000000 -0400
96 +++ mailman-2.1.5/cron/mailpasswds 2004-08-31 12:21:56.000000000 -0400
97 @@ -1,4 +1,4 @@
98 -#! @PYTHON@
99 +#! @PYTHON@ -S
100 #
101 # Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
102 #
103 diff -r -u mailman-2.1.5.orig/cron/nightly_gzip mailman-2.1.5/cron/nightly_gzip
104 --- mailman-2.1.5.orig/cron/nightly_gzip 2002-10-21 18:36:58.000000000 -0400
105 +++ mailman-2.1.5/cron/nightly_gzip 2004-08-31 12:22:32.000000000 -0400
106 @@ -1,4 +1,4 @@
107 -#! @PYTHON@
108 +#! @PYTHON@ -S
109 #
110 # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
111 #
112 diff -r -u mailman-2.1.5.orig/cron/senddigests mailman-2.1.5/cron/senddigests
113 --- mailman-2.1.5.orig/cron/senddigests 2002-10-21 18:36:58.000000000 -0400
114 +++ mailman-2.1.5/cron/senddigests 2004-08-31 12:22:44.000000000 -0400
115 @@ -1,4 +1,4 @@
116 -#! @PYTHON@
117 +#! @PYTHON@ -S
118 #
119 # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
120 #
121 diff -u mailman-2.1.5.orig/misc/mailman.in mailman-2.1.5/misc/mailman.in
122 --- mailman-2.1.5/misc/mailman.in.1 2005-02-15 11:08:47.244527000 -0500
123 +++ mailman-2.1.5/misc/mailman.in 2005-02-15 11:15:53.615729000 -0500
124 @@ -36,6 +36,36 @@
125 MAILMANHOME=@prefix@
126 MAILMANCTL=$MAILMANHOME/bin/mailmanctl
127
128 +# We used to install the mailman cron jobs when the mailman rpm was
129 +# installed, irrespective of whether mailman was actually being
130 +# run. Although the cron jobs didn't create any problems if someone
131 +# wasn't running mailman some users complained about the cron log file
132 +# filling up, resource usage, and power consumption since systems
133 +# wouldn't really idle. It really only makes sense to run the mailman
134 +# cron jobs if the mailman service is turned on and not just merely
135 +# having the rpm installed. This init.d script is an obvious place to
136 +# install or remove the cron jobs based on the service being enabled
137 +# or not.
138 +
139 +SRC_CRON_SCRIPT=$MAILMANHOME/cron/crontab.in
140 +DST_CRON_SCRIPT=/etc/cron.d/mailman
141 +
142 +function InstallCron()
143 +{
144 + install -m644 -o root -g root $SRC_CRON_SCRIPT $DST_CRON_SCRIPT
145 +}
146 +
147 +function RemoveCron()
148 +{
149 +cat > $DST_CRON_SCRIPT <<EOF
150 +# DO NOT EDIT THIS FILE!
151 +#
152 +# Contents of this file managed by /etc/init.d/mailman
153 +# Master copy is @prefix@/cron/crontab.in
154 +# Consult that file for documentation
155 +EOF
156 +}
157 +
158 # Source function library.
159 . /etc/rc.d/init.d/functions
160
161 @@ -47,7 +77,11 @@
162 echo -n $"Starting $prog: "
163 daemon $PYTHON $MAILMANCTL -s -q start
164 RETVAL=$?
165 - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
166 + if [ $RETVAL -eq 0 ]
167 + then
168 + touch /var/lock/subsys/$prog
169 + InstallCron
170 + fi
171 echo
172 return $RETVAL
173 }
174 @@ -57,7 +91,11 @@
175 echo -n $"Shutting down $prog: "
176 daemon $PYTHON $MAILMANCTL -q stop
177 RETVAL=$?
178 - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
179 + if [ $RETVAL -eq 0 ]
180 + then
181 + rm -f /var/lock/subsys/$prog
182 + RemoveCron
183 + fi
184 echo
185 return $RETVAL
186 }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed