[SOLVED] What symlinks leading into itself are good for?
4MLinuxThis forum is for the discussion of 4MLinux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I found that there are some symlinks which are leading into itself in live 4MLinux filesystem /:
folder /usr/local/ is symlink leads into itself /usr/local/
folder /usr/samba/ is symlink leads into itself /usr/samba/
'Cos when I go into it - it goes into /usr/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/ ... and so on ... dependency rate on as far as many clicks ...
Just curious about it - what is it good for if it leads to (seems to me) 'nowhere'.
(both folders are empty at this time).
Q1:
Why they are just not simply 'straight' folder instead of symlink?
Q2:
Speaks about symlinks - can someone tell me please, what is good for in '/usr' folder to create additional symlinks,
but which leads back to basic '/' linux folders:
/etc
/var
Does some software or access rights need it?
(but 4MLinux uses root acct anyway so no access troubles I guess right?)
'Cos (seems to me as laik) the whole linux is based on directory structure rootpaths /etc & /var - so why additional symlinks inside /usr of the same please? Isn't the path '/etc' shorter than path '/usr/etc'?
Thank you guys for info or links to help me understand it.
/usr/local/local/local/.... that is not good, most probably that is a bug somewhere.
/usr/bin will lead to /bin (and so on), that can be useful, do not need to maintain both /usr/bin and /bin. But that has probably a historical reason.
Yes - and also symlink
/usr/samba/
... works the same way - clickin' into multiple /usr/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/ ... and so on ... dependency rate on as far as many clicks ... (using pcmanfm).
In 4MLinux34.1 & Server too ... in "OutOfTheBox live CD" ... & I do rememember it was this way definitely already in versin 4MLinux30 (& Server) 'cos I was playing with it :-).
Could it do some errors with 'owerflow ...'? I can try how many times it can go into itself ...
About:
/usr/bin will lead to /bin (and so on), that can be useful, do not need to maintain both /usr/bin and /bin.
OK, thanx, now I've got it :-). I understand that /bin will be diferent for diferent users and system.
I just told that /etc & /var is always only the one version - for all of them, so just the one in root is enough.
I'm sorry, my apologize here :-).
ps: Misspelling correction - please read in all my previous posts - the incorrect "told" in correct form "thought".
... damn autocorrection :-).
Than you.
OK, zk, thank you also for info, now I've got it & understand the answer for Q2 from abowe:
I can see also in pcmanfm that folders are symlinks and 'Properties' of it shows where it leads.
About Q1: I was just wonder if is there any purpose that symlinks:
/usr/local
/usr/samba
... goes into still the same folder in cycle on & on & on ...?
In pcmanfm if I click on that folder to get into folder - it goes (by each click) inside more and more multiple times:
/usr/local/local/local/local/local/local/local/local/local/local/local/local/local/ ... and so on ...
/usr/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/samba/ ... and so on ...
I just tried - maximum is 40 times.
Then it shows all symlinks in /usr as they are broken - so not only those two:
/usr/local
/usr/samba
... but show that broken are all symlinks which are in /usr - so it means also:
/usr/etc
/usr/lib64
/usr/var
There is only one possible answer: some applications in 4MLinux make use of these links.
For example, they look for libraries in /usr/local/lib (and not just /usr/lib).
'Cos when I go into it - it goes into /usr/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/local/ ... and so on ...
Technically, this symlink doesn't lead back into itself then.
About your question: there's no need to rely on your gui filemanager when going into system directories. There.
If you want to continue the discussion, post terminal output, e.g.:
The terminal output is:
lrwxrwxrwx 1 root root 1 Nov 17 16:22 /usr/local -> /usr
OK, I can see that you are right guys here, zk1234 + ondodo. Thank you.
Also you're right about the 'Technically, this symlink doesn't lead back into itself then.'
It realy doesn't.
It was my mystake 'cos just 'doing clickin'' on that symlink again & again i pcmanfm showes still the same screen with the same 'stuff' in the same folder.
Only later I realized that in the top addres bar is 'grouing up' line with more '/local' or '/samba' ... up to 40 times max.
It seems to it is not realy important - so I don't wanna waste your time here.
Thank you a lot :-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.