#1 (permalink)  
Old 02-07-2005, 09:30 AM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-07-2005, 01:07 PM
chirpy's Avatar
Moderator
 
Join Date: Jun 2002
Location: Go on, have a guess
Posts: 13,495
chirpy will become famous soon enough
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
cPanel Forum Moderator

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-07-2005, 01:28 PM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-07-2005, 01:30 PM
chirpy's Avatar
Moderator
 
Join Date: Jun 2002
Location: Go on, have a guess
Posts: 13,495
chirpy will become famous soon enough
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
cPanel Forum Moderator

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-07-2005, 03:08 PM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-10-2005, 01:12 PM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-10-2005, 01:17 PM
chirpy's Avatar
Moderator
 
Join Date: Jun 2002
Location: Go on, have a guess
Posts: 13,495
chirpy will become famous soon enough
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
cPanel Forum Moderator

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-10-2005, 01:30 PM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-10-2005, 01:45 PM
chirpy's Avatar
Moderator
 
Join Date: Jun 2002
Location: Go on, have a guess
Posts: 13,495
chirpy will become famous soon enough
I would leave it as it is after you remove the chattr attributes (i.e. without them on).
__________________
Jonathan Michaelson
cPanel Forum Moderator

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-10-2005, 01:53 PM
verdon's Avatar
Registered User
 
Join Date: Nov 2003
Location: Northern Ontario, Canada
Posts: 784
verdon
Thanks, and also for the posts of yours I've found discussing exclude lists.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:43 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc