【问题】最近处理客户case时,发现重启服务时发现报如下错误
从错误信息可以看出是"/"目录的读写权限不对,尝试看根目录权限
[root@JDC2-TMSP-D ~]# ls -l /
total 150
drwxr-xr-x 2 root root 4096 Apr 26 2011 bin
drwxr-xr-x 4 root root 1024 Dec 8 2010 boot
drwxr-xr-x 10 root root 3820 Dec 8 2011 dev
drwxr-xr-x 91 root root 12288 Mar 16 04:03 etc
drwxr-xr-x 4 root root 4096 Aug 19 2012 home
drwxr-xr-x 14 root root 4096 Apr 26 2011 lib
drwx------ 2 root root 16384 Dec 8 2010 lost+found
drwxr-xr-x 2 root root 4096 Mar 30 2007 media
drwxr-xr-x 2 root root 0 Dec 8 2011 misc
drwxr-xr-x 7 root root 4096 Aug 20 2012 mnt
drwxr-xr-x 2 root root 0 Dec 8 2011 net
drwxr-xr-x 4 root root 4096 Jan 17 2011 opt
dr-xr-xr-x 109 root root 0 Dec 8 2011 proc
drwxr-x--- 8 root root 4096 Feb 13 11:46 root
drwxr-xr-x 2 root root 12288 Apr 26 2011 sbin
drwxr-xr-x 2 root root 4096 Dec 8 2010 selinux
drwxr-xr-x 2 root root 4096 Mar 30 2007 srv
drwxr-xr-x 11 root root 0 Dec 8 2011 sys
drwxrwxrwt 4 root root 4096 Mar 19 04:02 tmp
drwxrwxrwx 2 mysql mysql 4096 Aug 19 2012 tmpfile
drwxr-xr-x 14 root root 4096 Jan 25 2011 usr
drwxr-xr-x 21 root root 4096 Apr 8 2011 var
可以看出只能查看根目录下的文件权限,并不能看到根目录本身的权限。
查看ls 的help信息,发现-d 选项
-d, --directory list directory entries instead of contents,
and do not dereference symbolic links
[root@JDC2-TMSP-D ~]# ls -ld /
drwxr-xr-x 24 root root 4096 Feb 5 2013 /
问题解决。