You are not logged in.

#1 2015-02-19 07:21:49

Cyberess
Member
Registered: 2015-02-19
Posts: 5

How does one stop systemd-journald logging to console?

Hi All,

How does one stop systemd-journald logging to console?

I don't like the way that systemd-journald broadcasts messages to all consoles

In /etc/systemd/journald.conf I have set ForwardToConsole=no   

Done the "systemctl restart systemd-journald"

It will still broadcast

Just login at a any user run the command
logger -p local3.emerg test

that would broadcast  Broadcast message from systemd-journald@whatever ( that date )

It goes to all consoles, have I missed something here  --  can't even stop the messages via doing
systemctl stop systemd-journald

How does one control logging to console?

Offline

#2 2015-02-19 07:33:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How does one stop systemd-journald logging to console?

This is not the default behaviour, so presumably it is enabled somewhere (in your kernel line)?


Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-02-19 08:34:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How does one stop systemd-journald logging to console?

jasonwryan wrote:

This is not the default behaviour

Not sure what you mean, I get the same behavior as OP with

$ cat /proc/cmdline 
BOOT_IMAGE=../vmlinuz-linux root=/dev/sda1 rw quiet systemd.show_status=0 modprobe.blacklist=pcspkr initrd=../intel-ucode.img,../initramfs-linux.img

Did you test it yourself?

Offline

#4 2015-02-19 09:08:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How does one stop systemd-journald logging to console?

Test what? The journal doesn't log to consoles by default.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-02-19 09:12:38

Cyberess
Member
Registered: 2015-02-19
Posts: 5

Re: How does one stop systemd-journald logging to console?

Have you tried the command 'logger -p local3.emerg test'?

Where did it log to on your system?

Offline

#6 2015-02-19 09:19:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How does one stop systemd-journald logging to console?

It logged to the journal:

Feb 19 22:05:49 Shiv login[11747]: LOGIN ON tty4 BY jason
Feb 19 22:05:52 Shiv jason[11962]: test

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2015-02-19 14:10:50

Cyberess
Member
Registered: 2015-02-19
Posts: 5

Re: How does one stop systemd-journald logging to console?

O.K. yes good -- does the same for me,

Now it's more of what else it does, and anyone can test this  -- for me that message ends up on every opened gnome-terminal  and xterm that I have opened  -- even console screens

Even if other users are on the same system, that message would have broadcast on their terminals as well  --  That should never happen..  it's starting to look like a security issue as well.

Now another test  using a what is meant to be a unprivileged user
useradd -c "Silly User" -m  sillyuser

give that user a password and login on another terminal or even ssh into that server/workstation from another workstation.
and that user do  'logger -p local3.emerg "Ha Ha I'm writing to your screen"'
Better still have that unprivileged user put that in a while loop
while true; do 'logger -p local3.emerg "Ha Ha I'm writing to your screen"'; done

That message in the default setup of Arch Linux would have broadcast to every open terminal on that workstation -- that is seriously not good.

I discovered this is what I call a fault while evaluating Apache and php code and via remotely accessing the app website.

I have tried without success to switch off this broadcast messing from emerg level logging..  via setting in /etc/systemd/journald.conf  and via "systemctl restart systemd-journald"

This simple question here, is how does one switch off that silly broadcast logging to terminals?

Offline

#8 2015-02-19 14:31:29

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: How does one stop systemd-journald logging to console?

Cyberess wrote:

In /etc/systemd/journald.conf I have set ForwardToConsole=no

That is the default. You want to disable ForwardToWall (only one that's enabled by default and it only forwards emerg level messages unless you change MaxLevelWall.)

Offline

#9 2015-02-19 14:54:32

Cyberess
Member
Registered: 2015-02-19
Posts: 5

Re: How does one stop systemd-journald logging to console?

Thanks heaps  your got it..  that works  smile

edit /etc/systemd/journald.conf
ForwardToWall=no

systemctl restart systemd-journald

problem gone  --  that will be the default for all of my Arch Linux machines from now on or any Linux systems using systemd journal system

Now can anyone tell me why would ForwardToWall be enabled by default?  what use is it, as it could cause loss of use of the terminals.

Cheers

Offline

#10 2015-02-19 17:42:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How does one stop systemd-journald logging to console?

Offline

Board footer

Powered by FluxBB