Dead links in opensuse (Its a bug or a feature)

hi,

when i was running aide, the program was complaining about several dead links. since i would not believe this i tested this with:


for i in $(find / -type l); do ls -L $i || echo "$i is a dead link"; done

is this a bug a should report or normal behaviour.

greetings l1zard

On Thu, 01 Sep 2011 21:06:02 +0000, l1zard wrote:

> the program was complaining about several dead
> links.

What specific error messages did you get? Without specifics, it’d be
difficult for anyone to say if they were valid or not.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

A link is nothing but the path to the real file and it is interpreted as a link because the type is l. When you remove the destination, you have possibly one or more dead links because the destination does not know anything about the existance of those symbolic links. This is allready so since the symbolic link was invented in Unix long time ago.

About your question “is this a bug …”. I would think it is a feature. Dead links can become alive when you mount file systems where the target is. Unmounting file systems containing targets of symbolic links in other file systems should imho not lead to removal of those symbolic links.

Also implementation of removal of symbolic links when the target is removed would e a bit difficult. When I as user henk link to a target that is owned by you as user l1zard and you remove the target, you most probably would not be able to remove my link of which I am the owner.

To search for orphan links, this command would probably be faster:

find  -L / -xtype l -ls  | awk 'NF > 12 {print $11}' | sort -u

Normal behaviour.

ok thanks, i didn’t know this before.