Created
December 14, 2016 08:43
-
-
Save hilbix/1fd1af0b67e94725da17d3cf61d8b755 to your computer and use it in GitHub Desktop.
Prevent systemd-logind from spamming dmesg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Public Domain | |
# | |
# Prevent systemd-logind to spam dmesg | |
# | |
# Run this from something which catches the output, like | |
# https://github.com/hilbix/ptybuffer/blob/master/script/autostart.sh | |
mkdir -pm755 /run/systemd/journal | |
rm -f /run/systemd/journal/socket | |
date | |
( ( sleep 3; killall -1 systemd-logind ) & ) | |
exec socat -d -d unix-recv:/run/systemd/journal/socket - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only use this if you get SPAM in
dmesg
like:This means, you have no logger of systemd loaded. The output of above script will look like:
Please note:
The
sleep 3
and the script above is not ideal. The correct thing to do would be:Check, if
/run/systemd/journal/socket
exists and is functional.If functional, leave alone. Else remove and re-create the socket as shown above.
Check if
/run/systemd/journal/socket
now is functional. If so, reloadsystemd-logind
as shown.The problem is how to find out if a Unix-DGRAM-socket is functional from plain shell level.
Perhaps best would be to write a small wrapper which:
This might then lead to something like: