[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: broken system after srm -r -d /tmp/.* (user login and several services not working)



On 2008-07-03 18:58 +0200, Jonas Meurer wrote:

> On 03/07/2008 Sven Joachim wrote:
>> On 2008-07-03 11:42 +0200, Jonas Meurer wrote:
>> 
>> >> > When I try to su to a normal user from root, I get: "Cannot execute
>> >> > /bin/bash: Permission denied." The permissions for /bin/bash are ok:
>> >> > -rwxr-xr-x 1 root root 797784 2008-05-12 19:00 /bin/bash
>> 
>> Can you run su under strace and see where it fails?
>
> Sure, I attached the output of 'strace -f su tempuser'

It does not show anything that enlightens me, but see below.

> But I discovered something really strange. If I compare the output of
> 'ls -al /' on my system and in the chroot, several directory sizes seem
> to be different. I thought that directorys always have a size of
> 4069 bytes, but apparently this is not the case:

The size of directories is a multiple of the inode size, at least in
ext2/3 filesystems (might be different in reiserfs, I'm no expert).  If
a directory has many entries, its size grows and will not shrink back if
you delete these entries.  Since your system has been in use for several
years, the differences are not so strange.

> (on system) # ls -al /
> total 113
> drwx------  24 root root  4096 2008-07-03 18:51 .
> drwx------  24 root root  4096 2008-07-03 18:51 ..
> drwxr-xr-x   2 root root  4096 2008-06-30 22:11 bin
> drwxr-xr-x   4 root root  1024 2008-06-30 22:18 boot
> drwxr-xr-x   4 root root  4096 2008-07-02 19:41 chroot
> drwxr-xr-x  16 root root  4300 2008-07-03 18:49 dev
> drwxr-xr-x   3 root root  4096 2008-03-25 18:22 emul
> drwxr-xr-x 137 root root 12288 2008-07-03 18:49 etc
> drwxr-xr-x   6 root root  4096 2008-06-30 20:44 home
> drwxr-xr-x  15 root root 12288 2008-07-02 20:56 lib
> lrwxrwxrwx   1 root root    20 2008-03-25 18:22 lib32 -> /emul/ia32-linux/lib
> lrwxrwxrwx   1 root root     4 2008-03-25 18:27 lib64 -> /lib
> drwx------   2 root root 16384 2008-03-25 17:56 lost+found
> drwxr-xr-x   3 root root  4096 2008-06-30 13:30 media
> drwxr-xr-x   2 root root  4096 2008-05-18 16:37 mnt
> drwxr-xr-x   2 root root  4096 2008-03-25 18:08 opt
> dr-xr-xr-x 123 root root     0 2008-07-03 09:12 proc
> drwx------  20 root root  4096 2008-07-03 18:40 root
> drwxr-xr-x   2 root root 12288 2008-06-30 22:11 sbin
> drwxr-xr-x   2 root root  4096 2008-04-03 06:39 selinux
> drwxr-xr-x   3 root root  4096 2008-03-26 04:46 srv
> drwxr-xr-x  11 root root     0 2008-07-03 09:12 sys
> drwxrwxrwt   3 root root  4096 2008-07-03 18:40 tmp
> drwxr-xr-x  11 root root  4096 2008-05-31 01:00 usr
> drwxr-xr-x  16 root root  4096 2008-06-30 20:24 var
>
> boot, lib, sbin and sys all have very strange sizes on my system, don't
> they?

/boot seems to be on a different filesystem with an inode size of 1K,
/sys is a virtual filesystem in memory that occupies no space at all
(like /proc) and /lib contains usually quite a few files.  Only the size
of /sbin is a bit strange, since that directory is normally small ( I
have 125 files there).

Now to the failing su (and login) for non-root users:  Have a close look
at the first lines of your directory listing and tell me if you see
anything strange. ;-)

I bet that after "chmod 755 /" you will be able to log in as a normal
user again and your services will start to function. :-)

Cheers,
       Sven


Reply to: