LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-21-2012, 02:05 PM   #1
scott.anderson
Member
 
Registered: Mar 2005
Location: Natick, MA
Distribution: Redhat EL 5.2, Fedora 8
Posts: 30

Rep: Reputation: 15
"su" is slow for some accounts, not all, on CentOS 6.2


I and two or three student assistants administer my RHEL/CentOS 6.2 machine. Since I don't need to limit their powers, we use "su" rather than "sudo."

When I "su -" to root from my account, the operation is essentially instantaneous. From the accounts of both of my assistants, the "su -" command takes at least 45 seconds. (!!) I've also tested a couple of random user accounts, and it's 45+ seconds for those, too. It seems that only for my own account is it quick. All the accounts are essentially equivalent. They live in an LDAP database, hosted on the same RHEL 6 server. They have the same login shell. I can't think of any reason why they should be different.

Correction: They are almost the same, but the home directories are on different filesystems: The "su" is quick from several accounts that I tested where the home directory is in the /home partition. The "su" is slow from my student assistants, where the home directory is in the /students partition. These are both ext4 filesystems that are on the local RAID drive, so they are identical in terms of performance, locality to the machine, etc. The only difference is that there is (now) a quota set for the /students partition. However, this slowness pre-dates adding the ",usrquota,grpquota" mount options, so we can't blame the slowness on quotas. Still, it seems likely that the slowness has to do the filesystem partition. Note that su *to* an account in /students is just as fast as an su *to* an account in /home.

More data: The root username and password are in /etc/passwd and /etc/shadow, respectively. I have verified both the "setup" and "coreutils" RPM packages, and neither has been modified.

I thought it might perhaps be a caching sort of issue, but it continues to be slow even if I try several times in a row.

I tried doing an strace on the "su -" command, but for some reason the root password fails when I use strace. (No, I'm not repeated mis-typing the root password whenever I use strace; somehow, strace interferes with the functioning of the "su" command.) I can even see the root password in the strace output, and I know that it is being typed correctly. I noticed via the strace log that /etc/passwd is opened five times but that /etc/shadow is never opened, so I thought that was odd. But the core problem is that "su" is slow, not that I can't use "strace" on "su," so we don't really have to debug "strace."

I'm stumped. This is merely an annoyance, not a lack of function, but it's very annoying, and I'd appreciate any suggestions you have.

Here's some more information: One of my colleagues looked in /var/log/audit.log and found a bunch of avc denials until, finally, it gives up and lets the "su" proceed. So, the problem is an selinux problem (oh, joy). He also found the following: http://docs.redhat.com/docs/en-US/Re...ide/#id2839255 which suggests that the selinux context will be wrong for home directories that aren't in /home, which perfectly describes my situation. So, now I have to try to understand what's going on with having custom home directories. Unfortunately, I don't really understand the directions in the RHEL deployment guide, and I don't have "semanage" installed on my machine and I can't figure out what yum package supplies it.

Ok, that last bit seems to have done it. Guessing the semanage is in /usr/sbin/ and doing

# yum provides /usr/sbin/semanage

told me that it's provided by policycoreutils-python, which was easy to install. I then guessed that the RHEL documentation intended that /home/locale is the custom home dir, so I did

# semanage fcontext -a -e /home /students
# restorecon -R -v /students

That second command takes a while!

But, now, "su" is equally quick for my student assistants and for me!

Thanks, Scott

Last edited by scott.anderson; 02-21-2012 at 09:33 PM. Reason: Solution found
 
Old 02-21-2012, 06:53 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
What groups are your normal user account and the other users accounts

as in are all of you in the users group first

and is the time different from the SAME machine you are loging in to
or are they spread all over campus
 
Old 02-21-2012, 07:40 PM   #3
scott.anderson
Member
 
Registered: Mar 2005
Location: Natick, MA
Distribution: Redhat EL 5.2, Fedora 8
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by John VV View Post
What groups are your normal user account and the other users accounts
My account is in the "faculty" group. The student accounts are in their own group, which is the RedHat
standard. I've also has fast "su" from accounts that are in their own group, so the group doesn't seem
to distinguish between fast and slow "su."

Quote:
Originally Posted by John VV View Post
as in are all of you in the users group first
There is no "users" group on this machine, unless I'm misunderstanding you. Most accounts are in
their own group:

getent passwd jsmith
msmith:*:4678:4678:Michael Smith:/home/msmith:/bin/bash

Quote:
Originally Posted by John VV View Post
and is the time different from the SAME machine you are loging in to
or are they spread all over campus
I'm trying all the "su" from one machine. The different speeds are all on the one machine.

Thanks for your response!

Scott
 
Old 02-22-2012, 01:15 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
That was a nice read in the morning, to see somebody state a problem and step by step solving it by himself. Congrats and have a nice day, scott.anderson.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 4 07-12-2012 11:10 PM
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 2 01-23-2011 03:14 AM
vpopmail - how to get the list of "existing" email accounts thetotzky04 Linux - Newbie 1 10-22-2009 09:05 AM
Creating heavily restricted "upload" accounts Paiway Linux - Security 1 01-23-2005 09:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration