author | John Beck <John.Beck@Oracle.COM> |
Tue, 17 Feb 2015 16:34:10 -0800 | |
branch | s11-update |
changeset 3921 | 11f3a18e5d09 |
parent 3919 | e9daafafef42 |
permissions | -rw-r--r-- |
3919 | 1 |
This patch is Solaris-specific and thus will not be contributed upstream. |
2 |
||
3 |
--- mailman-2.1.18-1/misc/mailman.in.~1~ 2014-05-06 09:43:56.000000000 -0700 |
|
3921
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
4 |
+++ mailman-2.1.18-1/misc/mailman.in 2015-02-17 16:16:08.321600825 -0800 |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
5 |
@@ -33,13 +33,59 @@ |
3919 | 6 |
# config: @prefix@/Mailman/mm_cfg.py |
7 |
# pidfile: @prefix@/data/master-qrunner.pid |
|
8 |
||
9 |
+. /lib/svc/share/smf_include.sh |
|
10 |
+ |
|
11 |
PYTHON=@PYTHON@ |
|
12 |
MAILMANHOME=@prefix@ |
|
13 |
MAILMANCTL=$MAILMANHOME/bin/mailmanctl |
|
14 |
+DATABASEDIR=/var/share/mailman |
|
15 |
+ |
|
16 |
+# arguments: |
|
17 |
+# $1 (required): directory to check for and create if needed |
|
18 |
+# $2 (optional): mode |
|
19 |
+create_if_needed() |
|
20 |
+{ |
|
21 |
+ dir=$1 |
|
22 |
+ mode=02775 |
|
23 |
+ [[ $# -ge 2 ]] && mode=$2 |
|
24 |
+ if [[ ! -d $dir ]]; then |
|
25 |
+ mkdir -m $mode $dir |
|
26 |
+ chown mailman:mailman $dir |
|
27 |
+ fi |
|
28 |
+} |
|
29 |
||
30 |
case "$1" in |
|
31 |
'start') |
|
32 |
#rm -f $MAILMANHOME/locks/* |
|
33 |
+ |
|
34 |
+ # Directories under /var/share are only created after a reboot, when |
|
35 |
+ # an early-in-boot service migrates them from /var/.migrate . To allow |
|
36 |
+ # Mailman to be used after initial 'pkg install' before such a reboot, |
|
37 |
+ # we manually create the required directories here if needed. |
|
38 |
+ if [[ ! -d $DATABASEDIR ]]; then |
|
39 |
+ mkdir $DATABASEDIR |
|
40 |
+ create_if_needed $DATABASEDIR/archives |
|
41 |
+ create_if_needed $DATABASEDIR/archives/private 02771 |
|
42 |
+ create_if_needed $DATABASEDIR/archives/public |
|
43 |
+ create_if_needed $DATABASEDIR/lists |
|
44 |
+ create_if_needed $DATABASEDIR/locks |
|
45 |
+ create_if_needed $DATABASEDIR/logs |
|
46 |
+ create_if_needed $DATABASEDIR/qfiles |
|
47 |
+ create_if_needed $DATABASEDIR/spam |
|
48 |
+ fi |
|
49 |
+ |
|
50 |
+ # A single "site" list called mailman needs to exist first. Check for |
|
51 |
+ # it and create it if needed. |
|
52 |
+ $MAILMANHOME/bin/list_lists -b | grep -q "^mailman$" |
|
53 |
+ if [[ $? -ne 0 ]]; then |
|
54 |
+ $MAILMANHOME/bin/newlist -q -e 127.0.0.1 mailman [email protected] mailman |
|
55 |
+ fi |
|
3921
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
56 |
+ # Check to see if a crontab entry exists; if not, copy the input file |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
57 |
+ # into place. |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
58 |
+ crontab -l mailman > /dev/null 2>&1 |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
59 |
+ if [[ $? -ne 0 ]]; then |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
60 |
+ VISUAL="/usr/bin/cp $MAILMANHOME/cron/crontab.in" crontab -e mailman |
11f3a18e5d09
20258043 /var/mail/mailman fills up with cron output if mailman is unconfigured
John Beck <John.Beck@Oracle.COM>
parents:
3919
diff
changeset
|
61 |
+ fi |
3919 | 62 |
$PYTHON $MAILMANCTL -s -q start |
63 |
;; |
|
64 |