浏览代码

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 }}'

正在加载...
取消
保存