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.

file lock on /etc/yum.conf

Discussion in 'General Discussion' started by verdon, Feb 7, 2005.

  1. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Hi,

    I've been getting this error in my log for /scripts/upcp

    cannot get file lock on /etc/yum.conf: Bad file descriptor at /scripts/SafeFile.pm line 88.
    checkyum version 20.0

    I've done a bit of searching around here, and had a look at the files in question, but am not able to understand what it means. Is there anybody here who can shed some light on it?

    WHM 9.9.9 cPanel 9.9.9-S15**
    CentOS 3.3 i686 - WHM X v3.1.0

    I don't know if it's related or not, that CentOS has not updated to 3.4. From what I understand of reading http://www.centos.org/modules/news/article.php?storyid=34 it should have auto-updated.

    Following is the contents of my yum.conf

    Code:
    [main]
    cachedir=/var/cache/yum
    debuglevel=2
    logfile=/var/log/yum.log
    pkgpolicy=newest
    distroverpkg=redhat-release
    installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
    tolerant=1
    exactarch=1
    gpgcheck=1
    exclude=kernel* httpd* apache* exim* qmail* mod_* php* perl mysql* perl-suidperl perl-CPAN perl-CGI
    
    [base]
    name=CentOS-$releasever - Base
    baseurl=http://mirror.trouble-free.net/centos/$releasever/os/$basearch/
    
    #released updates
    [update]
    name=CentOS-$releasever - Updates
    baseurl=http://mirror.trouble-free.net/centos/$releasever/updates/$basearch/
    
    #packages used/produced in the build but not released
    [addons]
    name=CentOS-$releasever - Addons
    baseurl=http://mirror.trouble-free.net/centos/$releasever/addons/$basearch/
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=http://mirror.trouble-free.net/centos/$releasever/extras/$basearch/
    
    #packages in testing
    #[testing]
    #name=CentOS-$releasever - Testing
    #baseurl=http://mirror.trouble-free.net/centos/$releasever/testing/$basearch/
    
    [tf]
    name=$releasever tf updates
    baseurl=http://mirror.trouble-free.net/tf/$releasever/
    
    Should I manually force an update to CentOS 3.4?

    TIA for any tips or advice and please excuse my ignorance ;)

    Best regards,
    verdon
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Two things. Check that there isn't a lock oustanding on the file using:

    lsof | grep yum.conf

    If not, you could try copying /etc/centos-yum.conf to /etc/yum.conf (though there may just be a symlink from yum.conf to that file anyway).

    If you want to upgrade to v3.4 just follow the instructions on the CentOS website in the release.
     
  3. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    hi chirpy,

    Thanks for the tips.

    lsof | grep yum.conf doesn't return anything, so I guess it is not locked.

    /etc/centos-yum.conf and /etc/yum.conf are distinct files. They have different contents, but I think the difference is mostly so it will auto update non-version specific. That, and it looks like some things are excluded in yum.conf (I guess cpanel looks after them with cpanel specific builds on my box?)

    BTW... is there any reason why I wouldn't want to update to CentOS 3.4 on a fairly new box with fairly standard cpanel/whm setup?

    yum.conf:
    Code:
    [main]
    cachedir=/var/cache/yum
    debuglevel=2
    logfile=/var/log/yum.log
    pkgpolicy=newest
    distroverpkg=redhat-release
    installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
    tolerant=1
    exactarch=1
    gpgcheck=1
    exclude=kernel* httpd* apache* exim* qmail* mod_* php* perl mysql* perl-suidperl perl-CPAN perl-CGI
    
    [base]
    name=CentOS-$releasever - Base
    baseurl=http://mirror.trouble-free.net/centos/$releasever/os/$basearch/
    
    #released updates
    [update]
    name=CentOS-$releasever - Updates
    baseurl=http://mirror.trouble-free.net/centos/$releasever/updates/$basearch/
    
    #packages used/produced in the build but not released
    [addons]
    name=CentOS-$releasever - Addons
    baseurl=http://mirror.trouble-free.net/centos/$releasever/addons/$basearch/
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=http://mirror.trouble-free.net/centos/$releasever/extras/$basearch/
    
    #packages in testing
    #[testing]
    #name=CentOS-$releasever - Testing
    #baseurl=http://mirror.trouble-free.net/centos/$releasever/testing/$basearch/
    
    [tf]
    name=$releasever tf updates
    baseurl=http://mirror.trouble-free.net/tf/$releasever/
    
    centos-yum.conf:
    Code:
    [main]
    cachedir=/var/cache/yum
    debuglevel=2
    logfile=/var/log/yum.log
    pkgpolicy=newest
    distroverpkg=redhat-release
    installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
    tolerant=1
    exactarch=1
    
    [base]
    name=CentOS-$releasever - Base
    baseurl=http://mirror.centos.org/centos-3/$releasever/os/$basearch/
    gpgcheck=1
    
    #released updates 
    [update]
    name=CentOS-$releasever - Updates
    baseurl=http://mirror.centos.org/centos-3/$releasever/updates/$basearch/
    gpgcheck=1
    
    #packages used/produced in the build but not released
    [addons]
    name=CentOS-$releasever - Addons
    baseurl=http://mirror.centos.org/centos-3/$releasever/addons/$basearch/
    gpgcheck=1
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=http://mirror.centos.org/centos-3/$releasever/extras/$basearch/
    gpgcheck=1
    
    #packages in testing
    #[testing]
    #name=CentOS-$releasever - Testing
    #baseurl=http://mirror.centos.org/centos-3/$releasever/testing/$basearch/
    #gpgcheck=1
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No reason at all not to go up to 3.4 - works fine. This is the exclude list I currently use in yum:

    exclude=php* httpd* perl* mysql* mod_ssl* imap* squirrelmail* spamassassin* caching-nameserver*
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    hmm... looking at your exclude list and the one in mine explains why you had to manually install some perl mods a while ago when you were helping me troubleshoot your exim dictionary attack ACLs, a little while back.

    I think I'll tweak my yum.conf and then do a manual update to CentOS 3.4 in the next little while. That might solve the error in /scripts/upcp in the process.

    Thanks for the advice and bye for now,
    verdon
     
  6. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    hmm... I seem to be unable to write to yum.conf

    -rw-r--r-- 1 root root 1214 Nov 11 08:42 yum.conf

    root@host [/etc]# lsof | grep yum.conf
    root@host [/etc]#

    root@host [/etc]# cp centos-base-yum.conf yum.conf
    cp: overwrite `yum.conf', overriding mode 0644? yes
    cp: cannot create regular file `yum.conf': Permission denied

    root@host [/etc]# rm yum.conf
    rm: remove write-protected regular file `yum.conf'? yes
    rm: cannot remove `yum.conf': Operation not permitted

    root@ host [/etc]# chmod 777 yum.conf
    chmod: changing permissions of `yum.conf': Operation not permitted

    Any suggestions?
    Thanks
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Make sure that you haven't inadvertently added any chattr attributes:

    What do you get for:

    lsattr /etc/yum.conf

    If you get an i in the output:

    chattr -i /etc/yum.conf

    If you get an a in the output:

    chattr -a /etc/yum.conf
     
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks. I thought it might be something like that. I understand that chattr locks and protects files, but not knowing much more than that, I didn't do it ! ;)

    I get both...
    ----ia------- /etc/yum.conf

    So, I'll take your advice. Should I chattr this file again when I'm done? I suppose it was done when my NOC did the initial setup on my box, and likely to prevent inadvertent overwriting. It does seem likely though to be the culprit in my initial file lock problems on yum when upcp runs.
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I would leave it as it is after you remove the chattr attributes (i.e. without them on).
     
  10. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks, and also for the posts of yours I've found discussing exclude lists.
     
Loading...

Share This Page