2

Recently I ran into a problem with FTP server access. The server system logs shows that /etc/wu-ftpd/ftpaccess file is missing, as below:

wu-ftpd[15695]: cannot open access file /etc/wu-ftpd/ftpaccess: No such file or directory

After listing the contents of /etc/, I found serverl files were abnormal and the output contains several "?", and there is no /etc/wu-ftpd/ at all:

?--------- ? ? ? ? ? inputrc

?--------- ? ? ? ? ? nsswitch.conf.nis

?--------- ? ? ? ? ? pam.conf

?--------- ? ? ? ? ? syslog/ng

?--------- ? ? ? ? ? wu/ftpd

Is there any possible reason to cause such abnormal things, like disk problem, file system crash, or inadvertent human operation?

  • What is output of ls -ld /etc? – cuonglm May 13 '15 at 3:21
  • Here is it: ls -ld /etc drwxr-xr-x 76 root root 4096 May 12 18:36 /etc – zhicai May 13 '15 at 3:27
  • Did you copy+paste that output, or type it manually? Can you double check it's exactly correct? – Mikel May 13 '15 at 3:55
  • I used copy and paste. Anything related to the directory permission? – zhicai May 13 '15 at 4:36
  • What command did you use to get the output shown in your question?  Was it ls -l /etc (or something very similar)?  If so, that is very strange; such a command should never list filenames that contain slashes (e.g., syslog/ng and wu/ftpd).  Is /etc the only directory that has a problem?  Are all the files in /etc bad, or just a few?  You could have a severely corrupted filesystem. – G-Man May 13 '15 at 5:14
1

That is the result of filesystem corruption. The directory (which is just a file, too) lists entries that don't point to valid inodes. You should run fsck for whatever filesystem that is. Generally speaking, the filesystem must not be mounted when checked.

  • Thanks for your advice. Actually the system rebooted several times, but the issue was still there. I was expecting fsck to be run automatically in such scenario, isn't it true? – zhicai May 13 '15 at 6:11
  • Depends on the filesystem. xfs, for example, doesn't have an fsck (xfs_check and xfs_repair) Journaled fs's just replay the log and assume everything is ok. – Ricky Beam May 13 '15 at 6:24
  • Thanks. Our server is running ext3. Is it normal that fsck does not run after system reboot to fix the problem? – zhicai May 13 '15 at 6:44
  • By default, ext3 is checked by fsck automatically after n days or m mounts without check. AFAIK fsck doesn't automatically detect a corrupted filesystem at boot, let alone run and fix it. – dr01 May 13 '15 at 7:03
1

I have another answer - filesystem not corrupt, the execute permission on directory is not set.

Try this: (any linux but tested on CentOS 7.3)

cdir=MasterTest/config
mkdir -p $cdir/flue
touch $cdir/flue/goo
chmod 440 $cdir/*
chmod 440 $cdir/$DESC_FILE
ls -alstr $cdir

ls: cannot access MasterTest/config/flue: Permission denied
ls: cannot access MasterTest/config/..: Permission denied
ls: cannot access MasterTest/config/.: Permission denied
total 0
? d????????? ? ? ? ?            ? flue
? d????????? ? ? ? ?            ? ..
? d????????? ? ? ? ?            ? .

To recover:

chmod +x $cdir/
ls -alstr $cdir
total 12
4 drwxr-xr-x 3 me me 4096 May 19 14:25 ..
4 dr-xr-x--x 3 me me 4096 May 19 14:25 .
4 dr--r----- 2 me me 4096 May 19 14:25 flue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.