Is there a wall log?

There are some implementations of wall that write to syslog, for example http://salsa.debian.org/debian/sysvinit/blob/master/src/wall.c . In its manpage it says:

For every invocation of wall a notification will be written to syslog, with facility LOG_USER and level BR LOG_INFO

If you cannot control application's behavior or tell it to use logger instead of wall you can create a wall wrapper that would run a regular wall command and use logger to write to syslog. You can either create this wrapper in a new directory, add it to your $PATH and restart program that uses wall with new $PATH settings or, especially if you cannot even restart the program, replace system-wide wall for everyone if you have enough permissions to do so. In this example I will show you how to do the latter. First, rename existing wall program to wall.orig:

$ command -v wall
/usr/bin/wall
$ sudo mv /usr/bin/wall /usr/bin/wall.orig

The new /usr/bin/wall wrapper script could look like this:

#!/usr/bin/env sh

# wall wrapper - run wall commands with specified arguments and write
# a notification to syslog

wall.orig "$@"
logger "wall was ran with the following options: $*, result: $?"

Remember to make it executable:

sudo chmod +x /usr/bin/wall

Use it like a regular wall:

$ wall "test message"

Broadcast message from ja@comp (pts/14) (Sat Sep 14 22:34:43 2019):

test message

If you have a working logger and syslogd is running you should see the following message log in one of the files in /var/log that syslogd is routing the messages to:

Sep 14 22:34:43 comp ja: wall was ran with the following options: test message, result: 0

Of course, keep in mind that each time you will upgrade your system using its built-in upgrade mechanisms it's possible that the original /usr/bin/wall binary will be restored again.


There is a logging level that will write to all logged in users with wall

logger -p emerg 'The sky is falling in'

The logger with write messages to the appropriate file under /var/log. For emergency priority messages it will also send them to users with wall.

Tags:

Wall