From 8bd3f71edda5a06bca3327527738f2d5abdd29f1 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 11 Feb 2015 15:11:24 +0100 Subject: [PATCH] Turn off forwarding of systemd journal messages to syslog-ng 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 | 1 + modules/syslog-ng/files/syslog-ng.service | 5 ++--- modules/syslog-ng/manifests/init.pp | 5 +++++ modules/systemd/files/journald.conf | 7 +++++++ modules/systemd/manifests/init.pp | 5 +++++ 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 modules/systemd/files/journald.conf create mode 100644 modules/systemd/manifests/init.pp diff --git a/modules/debian-org/manifests/init.pp b/modules/debian-org/manifests/init.pp index a192c7d98..db9e9d37b 100644 --- a/modules/debian-org/manifests/init.pp +++ b/modules/debian-org/manifests/init.pp @@ -15,6 +15,7 @@ class debian-org { } if $systemd { + include systemd $servicefiles = 'present' } else { $servicefiles = 'absent' diff --git a/modules/syslog-ng/files/syslog-ng.service b/modules/syslog-ng/files/syslog-ng.service index 4d8fa2b6d..1248cf5a2 100644 --- a/modules/syslog-ng/files/syslog-ng.service +++ b/modules/syslog-ng/files/syslog-ng.service @@ -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 diff --git a/modules/syslog-ng/manifests/init.pp b/modules/syslog-ng/manifests/init.pp index b89109293..c55b6876b 100644 --- a/modules/syslog-ng/manifests/init.pp +++ b/modules/syslog-ng/manifests/init.pp @@ -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 index 000000000..7e6b60992 --- /dev/null +++ b/modules/systemd/files/journald.conf @@ -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 index 000000000..3caa98bc6 --- /dev/null +++ b/modules/systemd/manifests/init.pp @@ -0,0 +1,5 @@ +class systemd { + file { '/etc/systemd/journald.conf': + source => 'puppet:///modules/systemd/journald.conf', + } +} -- 2.20.1