kennym141282
asked on
ps showing user id not username
Hi,
I'm having this really odd problem with the test cluster (Ubuntu/Dapper + heartbeat 2.0.7) that I'm currently setting up.
I think the following summises it nicely:-
# id hacluster
uid=105(hacluster) gid=111(haclient) groups=111(haclient)
# grep hacluster /etc/passwd
hacluster:x:105:111:Heartb eat System Account,,,:/usr/lib/heartb eat:/bin/f alse
# grep hacluster /etc/shadow
hacluster:<snip - was valid hash!>:13412:0:99999:7:::
# ps -ef | grep heart
root 4767 1 0 13:51 ? 00:00:00 heartbeat: master control process
root 4804 4767 0 13:51 ? 00:00:00 heartbeat: FIFO reader
root 4805 4767 0 13:51 ? 00:00:00 heartbeat: write: bcast eth1
root 4806 4767 0 13:51 ? 00:00:00 heartbeat: read: bcast eth1
105 4849 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/ccm
105 4850 4767 0 13:55 ? 00:00:13 /usr/lib/heartbeat/cib
nobody 4851 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/lrmd
root 4852 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/stonith d
105 4853 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/attrd
105 4854 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/crmd
root 4855 4767 0 13:55 ? 00:00:01 /usr/lib/heartbeat/mgmtd -v
105 4856 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/pingd -h 192.168.100.1 -m 100 -d 5s
As you can see 'ps -ef' isn't showing hacluster but instead is showing the uid of 105.
Also worth noting is that heartbeat is telling these processes to run as "hacluster" so it's getting that bit right, it's almost as if it can't reverse lookup the userid but I'm just guessing now!
Any ideas are most appreciated...
I'm having this really odd problem with the test cluster (Ubuntu/Dapper + heartbeat 2.0.7) that I'm currently setting up.
I think the following summises it nicely:-
# id hacluster
uid=105(hacluster) gid=111(haclient) groups=111(haclient)
# grep hacluster /etc/passwd
hacluster:x:105:111:Heartb
# grep hacluster /etc/shadow
hacluster:<snip - was valid hash!>:13412:0:99999:7:::
# ps -ef | grep heart
root 4767 1 0 13:51 ? 00:00:00 heartbeat: master control process
root 4804 4767 0 13:51 ? 00:00:00 heartbeat: FIFO reader
root 4805 4767 0 13:51 ? 00:00:00 heartbeat: write: bcast eth1
root 4806 4767 0 13:51 ? 00:00:00 heartbeat: read: bcast eth1
105 4849 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/ccm
105 4850 4767 0 13:55 ? 00:00:13 /usr/lib/heartbeat/cib
nobody 4851 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/lrmd
root 4852 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/stonith
105 4853 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/attrd
105 4854 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/crmd
root 4855 4767 0 13:55 ? 00:00:01 /usr/lib/heartbeat/mgmtd -v
105 4856 4767 0 13:55 ? 00:00:00 /usr/lib/heartbeat/pingd -h 192.168.100.1 -m 100 -d 5s
As you can see 'ps -ef' isn't showing hacluster but instead is showing the uid of 105.
Also worth noting is that heartbeat is telling these processes to run as "hacluster" so it's getting that bit right, it's almost as if it can't reverse lookup the userid but I'm just guessing now!
Any ideas are most appreciated...
maybe a shot in the dark here, is there a user and group named hacluster?
Remove the following two lines from your /etc/nscd.conf file:
enable-cache passwd no
enable-cache group no
Then restart the nscd service.
enable-cache passwd no
enable-cache group no
Then restart the nscd service.
ASKER
# apt-cache policy nscd
nscd:
Installed: (none)
Candidate: 2.3.6-0ubuntu20
Version table:
2.3.6-0ubuntu20 0
500 http://gb.archive.ubuntu.com dapper/universe Packages
nscd isn't installed...
and...
# grep hacluster /etc/group
#
It's really puzzling!
nscd:
Installed: (none)
Candidate: 2.3.6-0ubuntu20
Version table:
2.3.6-0ubuntu20 0
500 http://gb.archive.ubuntu.com dapper/universe Packages
nscd isn't installed...
and...
# grep hacluster /etc/group
#
It's really puzzling!
what if cat /etc/passwd | grep -i 105
Sources are here:
http://procps.cvs.sourceforge.net/procps/
It uses getpwuid(uid) to get the name. So, the issue is down in that library.
Here's one version of that source:
getpwuid.c - http://www.google.com/codesearch?hl=en&q=+getpwuid+show:GCao5GWOX6Y:j2b_exIQ6aE:1sGKCqgnoog&sa=N&cd=3&ct=rc&cs_p=http://gentoo.osuosl.org/distfiles/Dev86src-0.16.17.tar.gz&cs_f=dev86-0.16.17/libc/getent/getpwuid.c#a0
__getwpent.c - http://www.google.com/codesearch?hl=en&q=show:von9tHYpwHY:j2b_exIQ6aE:stycz_AjqEA&sa=N&ct=rd&cs_p=http://gentoo.osuosl.org/distfiles/Dev86src-0.16.17.tar.gz&cs_f=dev86-0.16.17/libc/getent/__getpwent.c
Possible reasons:
The line in passwd may be malformed.
Maybe you're not using that version of getpwuid above. Are you on an LDAP based network? Then you might be using different libraries, and the libraries aren't reading /etc/passwd.
http://procps.cvs.sourceforge.net/procps/
It uses getpwuid(uid) to get the name. So, the issue is down in that library.
Here's one version of that source:
getpwuid.c - http://www.google.com/codesearch?hl=en&q=+getpwuid+show:GCao5GWOX6Y:j2b_exIQ6aE:1sGKCqgnoog&sa=N&cd=3&ct=rc&cs_p=http://gentoo.osuosl.org/distfiles/Dev86src-0.16.17.tar.gz&cs_f=dev86-0.16.17/libc/getent/getpwuid.c#a0
__getwpent.c - http://www.google.com/codesearch?hl=en&q=show:von9tHYpwHY:j2b_exIQ6aE:stycz_AjqEA&sa=N&ct=rd&cs_p=http://gentoo.osuosl.org/distfiles/Dev86src-0.16.17.tar.gz&cs_f=dev86-0.16.17/libc/getent/__getpwent.c
Possible reasons:
The line in passwd may be malformed.
Maybe you're not using that version of getpwuid above. Are you on an LDAP based network? Then you might be using different libraries, and the libraries aren't reading /etc/passwd.
ASKER
I am on an LDAP based network, but, nsswitch.conf shows the following:-
passwd: files ldap
group: files ldap
shadow: files ldap
passwd: files ldap
group: files ldap
shadow: files ldap
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.