I have Ubuntu 24.04 servers with this Journald config by default:
user@server:~$ systemd-analyze cat-config systemd/journald.conf # /etc/systemd/journald.conf # This file is part of systemd. ... [Journal] #Storage=auto #Compress=yes #Seal=yes #SplitMode=uid #SyncIntervalSec=5m #RateLimitIntervalSec=30s #RateLimitBurst=10000 #SystemMaxUse= #SystemKeepFree= #SystemMaxFileSize= #SystemMaxFiles=100 #RuntimeMaxUse= #RuntimeKeepFree= #RuntimeMaxFileSize= #RuntimeMaxFiles=100 #MaxRetentionSec= #MaxFileSec=1month #ForwardToSyslog=no #ForwardToKMsg=no #ForwardToConsole=no #ForwardToWall=yes #TTYPath=/dev/console #MaxLevelStore=debug #MaxLevelSyslog=debug #MaxLevelKMsg=notice #MaxLevelConsole=info #MaxLevelWall=emerg #LineMax=48K #ReadKMsg=yes #Audit=yes # /usr/lib/systemd/journald.conf.d/syslog.conf # Undo upstream commit 46b131574fdd7d77 for now. For details see # http://lists.freedesktop.org/archives/systemd-devel/2014-November/025550.html [Journal] ForwardToSyslog=yes At first I tought I could add ForwardToSyslog=no to /etc/systemd/journald.conf. But after this logs from Journal still appear also in /var/log/systlog. I reloaded Systemd and restarted Journald service. I even tried rebooting but nothing changed.
Then I read about drop-in config files and tried creating a drop-in config:
user@server:~$ systemd-analyze cat-config systemd/journald.conf # /etc/systemd/journald.conf # This file is part of systemd. ... [Journal] (everything commented out) # /usr/lib/systemd/journald.conf.d/syslog.conf # Undo upstream commit 46b131574fdd7d77 for now. For details see # http://lists.freedesktop.org/archives/systemd-devel/2014-November/025550.html [Journal] ForwardToSyslog=yes # /etc/systemd/journald.conf.d/override.conf [Journal] ForwardToSyslog=no But still logs from Journal appear in /var/log/syslog even after rebooting.
Then I manually edited /usr/lib/systemd/journald.conf.d/syslog.conf to read ForwardToSyslog=no. After that Journal entries no longer appear in /var/log/syslog.
But from the Systemd documentation I understood that files under /usr/lib/systemd should not be modified directly.
So what am I doing wrong here and what is the correct way to disable ForwardToSyslog?