Bug#672361: bootlogd: escape sequences should be filtered out

Jesse Smith jsmith at resonatingmedia.com
Tue Aug 13 19:53:42 BST 2019


On 8/13/19 2:06 PM, Dmitry Bogatov wrote:
> [2019-08-12 17:45] Jesse Smith <jsmith at resonatingmedia.com>
>> Certainly. Attached is a file with the last 20 lines of the
>> /var/boot/log file on a test machine. When I view the log with "less"
>> the output looks normal. When I run the file through "head" "tail" or
>> "cat" the "[ ok" part of the message line appears at the beginning of
>> the text. This happens in both the text console and in a virtual
>> terminal window.
> Ah, everything is clear now. Log file contains following escape
> sequence:
>
>   <ESC> [ 1 G
>
> It moves cursor to first column of terminal, so text after displaces
> text (timestamp) at beginning of line.

I came to a similar conclusion. I found I could edit the character
sequences in vim and pick which ones to keep or erase. As you pointed
out, editing or filtering some sequences makes for fragile formatting.
We could remove just those sequences in bootlogd, but I think the better
solution is (as you wrote) to fix the formatting in the program sending
us the log messages.




More information about the Debian-init-diversity mailing list