Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default file lock on /etc/yum.conf

    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/a...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. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    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. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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*
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    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. #6
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    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. #7
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  8. #8
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    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. #9
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    I would leave it as it is after you remove the chattr attributes (i.e. without them on).
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  10. #10
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Thanks, and also for the posts of yours I've found discussing exclude lists.

Similar Threads & Tags
Similar threads

  1. Another app is currently holding the yum lock; waiting for it to exit...
    By rlshosting in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-03-2009, 04:13 AM
  2. problems with yum.conf
    By staylor in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 09-11-2007, 10:44 AM
  3. Yum.conf Problems with Core 4
    By lloyd_tennison in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 11-01-2005, 11:47 PM
  4. yum.conf?
    By JordanKrainer in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-24-2005, 11:07 PM
  5. yum.conf
    By Antarius in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-03-2005, 04:22 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube