Sunday, January 28, 2024

Re: pkg_check -F confusion

Jan Stary <hans@stare.cz> writes:

> This is current/amd64 on a PC,
> with packages freshly updated.
>
> pkg_check(8) says:
>
> Other files (option -F)
> Checks that there are no other random objects under /usr/local.
>
> and later
>
> -F Check the filesystem for random objects
>
> without saying explictly which filesystem that is.
> (/usr/local is a separate filesystem in what follows.)
>
> Apparently, pkg_check looks at everything from the root down:
>
> Checking file system ...
> System libs NOT in locate dbs:
> /usr/lib/libc.so.96.5
> /usr/lib/libc.so.97.0
> /usr/lib/libc.so.97.1
>
> Why does pkg_check consider system libraries?
> Surely these don't belong to any package.
> Also, each of these _is_ in the locate db:
>
> $ locate libc.so
> /usr/lib/libc.so.96.1
> [...]

the locate dbs mentionned isn't the one at /var/db/locate.database
(updated by weekly(8) and used by default by locate(1)), but the ones at
/usr/lib/locate/src.db and /usr/X11R6/lib/locate/xorg.db (installed by
the OS at install time).

$ locate -d /usr/lib/locate/src.db:/usr/X11R6/lib/locate/xorg.db libc.so
base74:/usr/lib/libc.so.98.0
base74:/usr/share/relink/usr/lib/libc.so.98.0.a

> Lastly, it looks at /boot and /root/Mail
> and the smtpd queue and whatnot.
> Why is pkg_check looking at these?
>
> Unknown files:
> /boot
> /bsd
> /bsd.booted
> [...]

The method used for reporting unknown files using pkg_check is
relatively simple. If you want a more elaborated tool, you could use
sysclean(8).

The method used by sysclean(8) is explained at
https://kapouay.eu.org/notes/sysclean-intro/ .

Thanks.
--
Sebastien Marie

No comments:

Post a Comment