]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Turn off forwarding of systemd journal messages to syslog-ng
authorTollef Fog Heen <tfheen@err.no>
Wed, 11 Feb 2015 14:11:24 +0000 (15:11 +0100)
committerTollef Fog Heen <tfheen@err.no>
Wed, 11 Feb 2015 14:13:24 +0000 (15:13 +0100)
Modern syslogs (such as rsyslog and syslog-ng > 3.6) pull from the
systemd journal themselves. Tell systemd to not forward the messages
to syslog.  Also change it so syslog-ng no longer hooks into the
syslog.socket early boot stuff, since that causes headaches when it
tries to connect to loghost and can't resolve names.

modules/debian-org/manifests/init.pp
modules/syslog-ng/files/syslog-ng.service
modules/syslog-ng/manifests/init.pp
modules/systemd/files/journald.conf [new file with mode: 0644]
modules/systemd/manifests/init.pp [new file with mode: 0644]

index a192c7d98f3f102223227b869987db8c6b26e3c9..db9e9d37b03da8a7f9bea6e2c3d7d07412579025 100644 (file)
@@ -15,6 +15,7 @@ class debian-org {
        }
 
        if $systemd {
+               include systemd
                $servicefiles = 'present'
        } else {
                $servicefiles = 'absent'
index 4d8fa2b6dcc30698c1a7f1498dfe745601334f99..1248cf5a2791e13b47bbe28e935e30910b2a9b23 100644 (file)
@@ -4,12 +4,11 @@ Documentation=man:syslog-ng(8)
 
 [Service]
 Type=notify
-Sockets=syslog.socket
 ExecStart=/usr/sbin/syslog-ng -F
 ExecReload=/bin/kill -HUP $MAINPID
-StandardOutput=null
+StandardOutput=journal
+StandardError=journal
 Restart=always
 
 [Install]
 WantedBy=multi-user.target
-Alias=syslog.service
index b891092933a64e33e5a5775fbe19684b5d792ca6..c55b6876bee196182499c1db3746036c90ba4e8a 100644 (file)
@@ -37,5 +37,10 @@ class syslog-ng {
                        source => 'puppet:///modules/syslog-ng/syslog-ng.service',
                        notify => Exec['systemctl daemon-reload'],
                }
+
+               file { '/etc/systemd/system/syslog.service':
+                       ensure => absent,
+                       notify => Exec['systemctl daemon-reload'],
+               }
        }
 }
diff --git a/modules/systemd/files/journald.conf b/modules/systemd/files/journald.conf
new file mode 100644 (file)
index 0000000..7e6b609
--- /dev/null
@@ -0,0 +1,7 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+[Journal]
+ForwardToSyslog=no
diff --git a/modules/systemd/manifests/init.pp b/modules/systemd/manifests/init.pp
new file mode 100644 (file)
index 0000000..3caa98b
--- /dev/null
@@ -0,0 +1,5 @@
+class systemd {
+       file { '/etc/systemd/journald.conf':
+               source => 'puppet:///modules/systemd/journald.conf',
+       }
+}