您的位置:首页 > 运维架构 > Linux

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

2017-03-06 11:00 489 查看
[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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux