首页 > 代码库 > 软链接ln -s以及如何解决其产生“Too many levels of symbolic links ”的错误?

软链接ln -s以及如何解决其产生“Too many levels of symbolic links ”的错误?

[hadoop@hddcluster2 script]$ ls /etc/init.d/hadoop.sh 
ls: cannot access /etc/init.d/hadoop.sh: Too many levels of symbolic links
[hadoop@hddcluster2 script]$ ls /home/hadoop/script/hadoop.sh  /etc/init.d/hadoop.sh 
ls: cannot access /etc/init.d/hadoop.sh: Too many levels of symbolic links
/home/hadoop/script/hadoop.sh

解决办法:sudo 删除链接,然后补上全路径。

在做ln的时候要将文件的绝对路径下的完整目录写上去!例子如下:
[hadoop@hddcluster2 script]$ sudo rm /etc/init.d/hadoop.sh 
[hadoop@hddcluster2 script]$ sudo ln -s  /home/hadoop/script/hadoop.sh  /etc/init.d/hadoop.sh 
[hadoop@hddcluster2 script]$ /etc/init.d/hadoop.sh st
/etc/init.d/hadoop.sh {start|stop|restart|status}
[hadoop@hddcluster2 script]$ /etc/init.d/hadoop.sh status
11283 ResourceManager
12323 Jps
10836 DataNode
10694 NameNode
11033 SecondaryNameNode
11610 NodeManager
11756 JobHistoryServer


本文出自 “禅剑一如” 博客,请务必保留此出处http://yanconggod.blog.51cto.com/1351649/1903566

软链接ln -s以及如何解决其产生“Too many levels of symbolic links ”的错误?