Page 1 of 1

os-prober to avoid debug entries in system logs

Posted: 2022-07-29 12:56
by frank67
Hi everybody,

I'm using Debian 11.4 Bullseye amd64 when I run update-grub2 command I get lots of debug information in log file (about 2000 lines).

# update-grub2
# journalctl --since "2022-07-29 13:45:00" (you must set your command execution time)

Code: Select all

<snip>
-- Journal begins at Mon 2022-05-16 13:34:14 CEST, ends at Fri 2022-07-29 13:50:23 CEST. --
lug 29 13:46:12 itek os-prober[31293]: debug: /dev/sda1: part of software raid array
lug 29 13:46:12 itek os-prober[31297]: debug: /dev/sdb1: part of software raid array
lug 29 13:46:12 itek os-prober[31301]: debug: /dev/sdc1: part of software raid array
lug 29 13:46:12 itek os-prober[31305]: debug: /dev/sdd1: part of software raid array
lug 29 13:46:12 itek os-prober[31322]: debug: running /usr/lib/os-probes/mounted/05efi on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 05efi[31324]: debug: Not on UEFI platform
lug 29 13:46:12 itek os-prober[31325]: debug: running /usr/lib/os-probes/mounted/10freedos on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 10freedos[31327]: debug: /dev/mapper/ld0-data is not a FAT partition: exiting
lug 29 13:46:12 itek os-prober[31328]: debug: running /usr/lib/os-probes/mounted/10qnx on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 10qnx[31330]: debug: /dev/mapper/ld0-data is not a QNX4 partition: exiting
lug 29 13:46:12 itek os-prober[31331]: debug: running /usr/lib/os-probes/mounted/20macosx on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek macosx-prober[31333]: debug: /dev/mapper/ld0-data is not an HFS+ partition: exiting
lug 29 13:46:12 itek os-prober[31334]: debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 20microsoft[31336]: debug: /dev/mapper/ld0-data is not a MS partition: exiting
lug 29 13:46:12 itek os-prober[31337]: debug: running /usr/lib/os-probes/mounted/30utility on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 30utility[31339]: debug: /dev/mapper/ld0-data is not a FAT partition: exiting
lug 29 13:46:12 itek os-prober[31340]: debug: running /usr/lib/os-probes/mounted/40lsb on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek os-prober[31342]: debug: running /usr/lib/os-probes/mounted/70hurd on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek os-prober[31344]: debug: running /usr/lib/os-probes/mounted/80minix on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek os-prober[31346]: debug: running /usr/lib/os-probes/mounted/83haiku on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek 83haiku[31348]: debug: /dev/mapper/ld0-data is not a BeFS partition: exiting
lug 29 13:46:12 itek os-prober[31349]: debug: running /usr/lib/os-probes/mounted/90linux-distro on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek os-prober[31353]: debug: running /usr/lib/os-probes/mounted/90solaris on mounted /dev/mapper/ld0-data
lug 29 13:46:12 itek os-prober[31372]: debug: running /usr/lib/os-probes/50mounted-tests on /dev/mapper/ld0-lv2
lug 29 13:46:12 itek 50mounted-tests[31404]: debug: mounted using GRUB ext2 filesystem driver
lug 29 13:46:12 itek 50mounted-tests[31405]: debug: running subtest /usr/lib/os-probes/mounted/05efi
lug 29 13:46:12 itek 05efi[31407]: debug: Not on UEFI platform
lug 29 13:46:12 itek 50mounted-tests[31408]: debug: running subtest /usr/lib/os-probes/mounted/10freedos
lug 29 13:46:12 itek 10freedos[31410]: debug: /dev/mapper/ld0-lv2 is not a FAT partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31411]: debug: running subtest /usr/lib/os-probes/mounted/10qnx
lug 29 13:46:12 itek 10qnx[31413]: debug: /dev/mapper/ld0-lv2 is not a QNX4 partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31414]: debug: running subtest /usr/lib/os-probes/mounted/20macosx
lug 29 13:46:12 itek macosx-prober[31416]: debug: /dev/mapper/ld0-lv2 is not an HFS+ partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31417]: debug: running subtest /usr/lib/os-probes/mounted/20microsoft
lug 29 13:46:12 itek 20microsoft[31419]: debug: /dev/mapper/ld0-lv2 is not a MS partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31420]: debug: running subtest /usr/lib/os-probes/mounted/30utility
lug 29 13:46:12 itek 30utility[31422]: debug: /dev/mapper/ld0-lv2 is not a FAT partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31423]: debug: running subtest /usr/lib/os-probes/mounted/40lsb
lug 29 13:46:12 itek 50mounted-tests[31425]: debug: running subtest /usr/lib/os-probes/mounted/70hurd
lug 29 13:46:12 itek 50mounted-tests[31427]: debug: running subtest /usr/lib/os-probes/mounted/80minix
lug 29 13:46:12 itek 50mounted-tests[31429]: debug: running subtest /usr/lib/os-probes/mounted/83haiku
lug 29 13:46:12 itek 83haiku[31431]: debug: /dev/mapper/ld0-lv2 is not a BeFS partition: exiting
lug 29 13:46:12 itek 50mounted-tests[31432]: debug: running subtest /usr/lib/os-probes/mounted/90linux-distro
lug 29 13:46:13 itek 90linux-distro[31446]: result: /dev/mapper/ld0-lv2:Debian GNU/Linux 7 (wheezy):Debian:linux
lug 29 13:46:13 itek 50mounted-tests[31447]: debug: os found by subtest /usr/lib/os-probes/mounted/90linux-distro
</snip>
Out of curiosity is there a way to make os-prober quiet in order to avoid all those useless debug entries in the system logs?
Should I submit a bug report against os-prober package?
Kind regards

Re: os-prober to avoid debug entries in system logs

Posted: 2022-07-29 21:05
by Head_on_a_Stick
Add this line to /etc/default/grub:

Code: Select all

OS_PROBER_DISABLE_DEBUG=true
EDIT: it took me less than a minute to find https://bugs.debian.org/cgi-bin/bugrepo ... bug=698598 with a search engine, perhaps try that first next time?

Re: os-prober to avoid debug entries in system logs

Posted: 2022-08-01 14:11
by frank67
Hi,

I've added OS_PROBER_DISABLE_DEBUG=true at the bottom of /etc/default/grub but has no effect, then I tried OS_PROBER_ENABLE_DEBUG=false but it was the same. I run update-grub2 command twice thinking it was necessary but the output in system log is always the same, lots of debug entries:

Code: Select all

# update-grub2
# journalctl --since "2022-08-01 14:13:00" >osprober.txt
# wc -l osprober.txt 
1936 osprober.txt
Are you sure that OS_PROBER_DISABLE_DEBUG=true had to be set in /etc/default/grub ? In the bug report isn't mentioned.

TIA

Re: os-prober to avoid debug entries in system logs

Posted: 2022-08-01 14:16
by Head_on_a_Stick
frank67 wrote: 2022-08-01 14:11 Are you sure that OS_PROBER_DISABLE_DEBUG=true had to be set in /etc/default/grub ?
It's mentioned in the changelog for v1.72:

Code: Select all

  * Disable debugging if OS_PROBER_DISABLE_DEBUG is set (thanks, Hedayat
    Vatankhah; closes: #698598).
https://metadata.ftp-master.debian.org/ ... _changelog

Perhaps a regression has b0rked the option. If nobody else has any ideas take it upstream.

Re: os-prober to avoid debug entries in system logs

Posted: 2022-08-03 16:02
by frank67
There are at least other two bug reports about OS_PROBER_DISABLE_DEBUG not working, one of these proposing a patch to fix lot of debug messages in system log:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=932974
https://bugs.debian.org/cgi-bin/bugrepo ... bug=912896

The workaround I found is to edit /usr/share/os-prober/common.sh file then look for the "debug()" function and comment out the log command, in this way:

Code: Select all

debug() {
  if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
    : # log "debug: $@"
  fi
}
I don't know why "Debian Install System Team" guys still don't apply the patch :(
HTH

Re: os-prober to avoid debug entries in system logs

Posted: 2022-08-03 16:28
by Head_on_a_Stick
frank67 wrote: 2022-08-03 16:02

Code: Select all

debug() {
  if [ -z "$OS_PROBER_DISABLE_DEBUG" ]; then
    : # log "debug: $@"
  fi
}
Ah, I see.

To apply the option add this line to /etc/environment:

Code: Select all

OS_PROBER_DISABLE_DEBUG='Please shut the **** up'
Then save the file and reboot to test (after restoring the debug() function in common.sh).

The option does work but the application is non-obvious :-)