On Fri, 16 Sep 2022 14:55:11 +1000
"Michael D. Setzer II via users" <users@lists.fedoraproject.org> wrote:

> I've run this little script from time to time in /
> 
> find . -xtype l >/badlinks 2>ERR
> grep -v '/proc\|/run' </badlinks >/badlinks-clean
> 
> At present ends up with other 300 lines in the 
> badlinks-clean
> 
> Cleaned up a number of bad lines in a jre directory that 
> seemed to be left over stuff from fc27 to fc33? Nothing 
> from fc34?? and the reset were the currect fc35 files I 
> have on system. Seems things that just got left??
> 
> Not sure if it is coming to have these on a system? 
> 
> Wonder if someone with a lot more knowledge than I 
> have might know best option. Just leave them, remove 
> some, remove all? Figured the ones in /proc and /run 
> should be left alone??

I don't have a lot more knowledge than you do, but a symbolic link that
points to nothing, is broken, is useless.  Anything that depends on
finding what it expects at the end of the link is going to break.
So, my opinion is that removing them is harmless.  If your system is
working correctly, then leaving them is also harmless, other than the
cruft it represents, because they aren't being accessed (or you would
be getting errors).

The proc / run links are temporary, in that the proc / run filesystem
is created each boot, so deleting them is pointless.  It doesn't make
sense that there are all those broken links.  Could the find be
incorrect in some way?  By that I mean that it is issuing false
positives.  When I run the command
find /proc -L -type l | less
or
find /run -L -type l | less
I get no broken links.

From the find man page for -type l,
l      symbolic  link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is broken.  If
you want to search for symbolic links when -L is in effect, use
-xtype.

So, using find /proc -L -type l returns true if a link is broken.  Note
that the default for find is -P, never follow symbolic links, which
your command will use.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to