Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Suppress all tty logging for services (Read 1149 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Suppress all tty logging for services

I currently have an Artix installation on an old laptop set up with Runit, using pure iwd for wireless networking. This also means I have to enable the iwd service through Runit, but now that means that iwd instantly logs everything it does to (I believe) /dev/console, which defaults to tty1. This also means that as soon as the login prompt shows up, it immediately gets clogged up with the output of the iwd service (see attached).

Having searched around here before, I'm aware that is is possible to set console=ttyX through the kernel to move all the logging onto another tty instance, though it feels a bit cheaty to do so. Instead, I was wondering if it was possible to suppress service logging to tty either entirely or on a per-service basis. So how would I go about disabling it altogether instead of just moving it off-screen?

Re: Suppress all tty logging for services

Reply #1
Actually, I believe that runit hardcodes printing its output to tty1 so changing the kernel parameter wouldn't work (someone can correct me here). As for redirecting the output, an easy way to completely silence it is to edit the runit script and merely redirect all the output to /dev/null (i.e. append "2> /dev/null" to the actual iwd command). If you want to keep the logs, it would be more complicated.

Re: Suppress all tty logging for services

Reply #2
append "2> /dev/null" to the actual iwd command
That did the trick. In my /etc/runit/runsvdir/default/iwd/run I've now got
Code: [Select]
exec /usr/lib/iwd/iwd ${OPTS} 2>/dev/null
For now I'm not really interested in any of the output from iwd, so I'm happy with that. Cheers!