The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Freebsd 5.4 - 'Bad File Descriptor'

Discussion in 'General Discussion' started by ninja_byte, Nov 6, 2006.

  1. ninja_byte

    ninja_byte Member

    Joined:
    May 6, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    So, I have a few experimental Freebsd 5.4 cpanel machines. One just started acting very funny. For a while we couldnt login remotely because it was reporting errors with /etc/spwd.db.

    After logging in via single user mode, i started investigating:

    ls -l /etc/spwd.db
    ls: /etc/spwd.db: Bad file descriptor

    ooooook, what the hell. Anyway, I wasn't able to write to it, rm it, etc, but I was able to rename it to spwd.db.BAD

    I regenerated the file with pwd_mkdb /etc/master.passwd .

    Now, 2 days later, I'm getting oddball errors, and a bunch of my files in that folder are messed up as well..!

    root@freebsd-cp-5-4# for i in /etc/*; do ls -l $i >/dev/null; done
    ls: /etc/bleh: Bad file descriptor
    ls: /etc/bleh2: Bad file descriptor
    ls: /etc/master.passwd,v: Bad file descriptor
    ls: /etc/pwd.db: Bad file descriptor
    ls: /etc/quota.conf,v: Bad file descriptor
    ls: /etc/relayhosts: Bad file descriptor
    ls: /etc/relayhosts.bad: Bad file descriptor
    ls: /etc/relayhostsusers: Bad file descriptor
    ls: /etc/relayhostsusers.bad: Bad file descriptor
    ls: /etc/spwd.db.BACKUP20061103: Bad file descriptor
    ls: /etc/trueuserdomains: Bad file descriptor
    ls: /etc/trueuserowners: Bad file descriptor


    Trussed it, nothing useful:
    stat("/etc/pwd.db",0xbfbfe5a0) ERR#9 'Bad file descriptor'
    lstat("/etc/pwd.db",0xbfbfe5a0) ERR#9 'Bad file descriptor'
    open(".",0x0,00) = 3 (0x3)
    ls: write(2,0xbfbfd9b0,4) = 4 (0x4)
    /etc/pwd.db: Bad file descriptorwrite(2,0xbfbfd9d0,32)

    Tried it in perl, no dice:
    root@freebsd-cp-5-4#perl -e'
    open(FILE, "/etc/relayhosts.bad") or die("$!");
    close(FILE);'

    Bad file descriptor at -e line 2.


    I tried fsck'ing the / partition, and it did NOTHING. Anyone have some insight into this? It's a bit odd that only cpanel-related files stuff are being affected here...
     

Share This Page