瀏覽代碼

Merge pull request #516 from carljm/opendmarc-silent-cron

Make OpenDMARC cron job log everything instead of mailing some output to root.
Sven Neuhaus 8 年之前
父節點
當前提交
d1df544634
共有 2 個檔案被更改,包括 4 行新增2 行删除
  1. 1
    2
      roles/mailserver/tasks/opendmarc.yml
  2. 3
    0
      roles/mailserver/templates/etc_opendmarc_report.sh.j2

+ 1
- 2
roles/mailserver/tasks/opendmarc.yml 查看文件

@@ -38,5 +38,4 @@
38 38
   file: path=/var/run/opendmarc/opendmarc.dat state=touch owner=opendmarc group=opendmarc
39 39
 
40 40
 - name: Activate OpenDMARC report cronjob
41
-  cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log"
42
-
41
+  cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log 2>&1 || tail /var/log/opendmarc_report.log"

+ 3
- 0
roles/mailserver/templates/etc_opendmarc_report.sh.j2 查看文件

@@ -1,5 +1,8 @@
1 1
 #!/bin/bash
2 2
 
3
+# ensure this script errors out if any of its steps do
4
+set -e
5
+
3 6
 DB_SERVER='localhost'
4 7
 DB_USER='{{ mail_db_opendmarc_username }}'
5 8
 DB_PASS='{{ mail_db_opendmarc_password }}'

Loading…
取消
儲存