Jelajahi Sumber

systemd: prevent redundancy in journal

Originating from a dual sink (stderr and syslog).

Annotated example from "journalctl -b --no-hostname -u corosync":

Aug 14 00:27:45 corosync[5203]:  [MAIN  ] Corosync Cluster
Engine ('2.99.3'): started and ready to provide service.
  ^ from syslog source
Aug 14 00:27:45 corosync[5203]: notice  [MAIN  ] Corosync Cluster
Engine ('2.99.3'): started and ready to provide service.
  ^ from stderr source

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Jan Pokorný 7 tahun lalu
induk
melakukan
c34208ad40
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      init/corosync.service.in

+ 7 - 0
init/corosync.service.in

@@ -10,6 +10,13 @@ EnvironmentFile=-@INITCONFIGDIR@/corosync
 ExecStart=@SBINDIR@/corosync -f $COROSYNC_OPTIONS
 Type=notify
 
+# In typical systemd deployments, both standard outputs are forwarded to
+# journal (stderr is what's relevant in the pristine corosync configuration),
+# which hazards a message redundancy since the syslog stream usually ends there
+# as well; before editing this line, you may want to check DefaultStandardError
+# in systemd-system.conf(5) and whether /dev/log is a systemd related symlink.
+StandardError=null
+
 # The following config is for corosync with enabled watchdog service.
 #
 #  When corosync watchdog service is being enabled and using with