I'm root, but I don't have permission to run yum.

Justin

Verified User
Joined
Sep 28, 2005
Messages
6
[root@server bwm-ng-0.6]# yum install libpcap ncurses-devel
Loading "installonlyn" plugin
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 88, in main
base.doLock()
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 545, in doLock
while not self._lock(lockfile, mypid, 0644):
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 587, in _lock
if not msg.errno == errno.EEXIST: raise msg
OSError: [Errno 13] Permission denied: '/var/run/yum.pid'
[root@server bwm-ng-0.6]# whoami
root
[root@server bwm-ng-0.6]#


I'm root, but I don't have permission to run yum ? May I know what happen to this ?
 

I did see this post many times. But this is not the solution for me.

[root@server ntop-3.3.9]# service httpd restart
rm: cannot remove `/var/run/httpd.pid': Permission denied [ OK ]

rm: cannot remove `/var/run/httpd.pid': Permission denied
Starting httpd:
[root@server ntop-3.3.9]#


I do have this problem too.
I thought root is the highest access ?
Thank you for reply.
 
/var/run permissions are messed up

ls -ld /var/run
 
/var/run permissions are messed up

ls -ld /var/run


[root@server ntop-3.3.9]# ls -ld /var/run
drwxr-xr-x 19 root root 4096 Mar 9 07:31 /var/run
[root@server ntop-3.3.9]#
[root@server ntop-3.3.9]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@server ntop-3.3.9]# service mysql restart
Shutting down MySQL..Manager of pid-file quit without updat[FAILED].
Failed to stop running server, so refusing to try to start.[FAILED]
[root@server ntop-3.3.9]# service httpd restart
rm: cannot remove `/var/run/httpd.pid': Permission denied [ OK ]

rm: cannot remove `/var/run/httpd.pid': Permission denied
Starting httpd:
[root@server ntop-3.3.9]#


I get this message.
 
Turn off SELinux if it's on.

Make sure the files aren't chattr'd read-only.

Jeff
 
Turn off SELinux if it's on.

Make sure the files aren't chattr'd read-only.

Jeff

[root@server ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0




and then this


[root@server ~]# lsattr /var/run
------------- /var/run/utmp
------------- /var/run/exim.pid
------------- /var/run/saslauthd
------------- /var/run/setrans
------------- /var/run/haldaemon.pid
------------- /var/run/sc_trans.pid
------------- /var/run/sc_serv.pid
------------- /var/run/syslogd.pid
------------- /var/run/ppp
------------- /var/run/gpm.pid
------------- /var/run/messagebus.pid
------------- /var/run/sudo
------------- /var/run/httpd.pid
------------- /var/run/atd.pid
------------- /var/run/rpc.statd.pid
------------- /var/run/proftpd.pid
------------- /var/run/wpa_supplicant
------------- /var/run/netreport
------------- /var/run/nscd
------------- /var/run/crond.pid
------------- /var/run/console
------------- /var/run/mdadm
------------- /var/run/sshd.pid
------------- /var/run/proftpd
------------- /var/run/xfs.pid
------------- /var/run/dovecot
------------- /var/run/NetworkManager
------------- /var/run/cupsd.pid
lsattr: Operation not supported While reading flags on /var/run/sdp
------------- /var/run/cups
------------- /var/run/mdmpd
------------- /var/run/klogd.pid
------------- /var/run/named
------------- /var/run/avahi-daemon
------------- /var/run/xinetd.pid
------------- /var/run/directadmin.pid
lsattr: Operation not supported While reading flags on /var/run/acpid.socket
------------- /var/run/da-popb4smtp.pid
------------- /var/run/dbus
[root@server ~]#




I cannot restart MySQL in here, but I can restart in DirectAdmin web interface.
Still cannot figure out what happen. I remember last time can restart normally in shell.
 
Did you try disabling SELinux?

Jeff

Thank you for you reply.

I've show the root@server ~]# cat /etc/selinux/config in previous post that I've disable the selinux.

Then now I tried this too.
[root@server ~]# setenforce 0
setenforce: SELinux is disabled
[root@server ~]# service httpd restart
rm: cannot remove `/var/run/httpd.pid': Permission denied [ OK ]
rm: cannot remove `/var/run/httpd.pid': Permission denied
Starting httpd:
[root@server ~]#

Still the same. Wish can solve this problem.
 
Did you patch and build the kernel yourself, maybe with a RBAC system like the one from grsecurity?
Maybe your /var partition is mounted real-only (but the error should be different...), or you have some security LKM loaded, or your system has been compromised with a rootkit.
That's all I can think of at the moment.
 
Back
Top