Operating System - HP-UX
1830503 Members
2586 Online
110006 Solutions
New Discussion

ls command show groupid and not groupname

 
RogerVI
Regular Advisor

ls command show groupid and not groupname

Hi gurus
I have a rp5400 with HP-UX 11.00
The problem is that when I run ls -l I see the group id and not the group name
For example, the file /etc/group I see:

-r--r--r-- 1 bin 2 1026 Sep 2 11:13 group

and not

-r--r--r-- 1 bin bin 1026 Sep 2 11:13 group


I checked the /etc/group for corrupted line
I stopped and restarted the daemon pwgrd but the problem continue
pwck and grpck no report problem

When I use sam for configuration of users and groups I can add a new group but
I can not add a new user within the group created. I get the follwing error:
could not modify the /etc/group file

Whats wrong ?

Thank in advance
Roger
22 REPLIES 22
VEL_1
Valued Contributor

Re: ls command show groupid and not groupname

Hi,

It means, your group is removed or deleted. it will use the deleted group id instead group name

Eg:

# groupadd test.txt
# chown bin:test test.txt
# ls -l test.txt
rw-r--r-- 1 bin test <.......>
# groupdel test
# ls -l test.txt
rw-r--r-- 1 bin 501 <......>

A. Clay Stephenson
Acclaimed Contributor

Re: ls command show groupid and not groupname

Are you running NIS, NIS+, or LDAP?

Do an ls -l /etc/group and post that output.
Attach your /etc/nsswitch.conf file. Does it matter if you do an ls -l file as root?
If you kill pwgrd (and not restart it -- you don't really need it), does that change the behavior of ls -l? Finaaly, do a bdf and make sure that there is free space in all filesystems.
If it ain't broke, I can fix that.
morganelan
Trusted Contributor

Re: ls command show groupid and not groupname

I think your bin group has been deleted from your /etc/group.Could you please post your /etc/group contents?
Kamal Mirdad
Arunvijai_4
Honored Contributor

Re: ls command show groupid and not groupname

It clearly shows that your "group" is removed from /etc/group. Try adding your "group" name in /etc/group and let us know the results.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
A. Clay Stephenson
Acclaimed Contributor

Re: ls command show groupid and not groupname

I am making the assumption that the group name mapping is missing from all ls -l's and not just a few files or those belonging to a few groups.
If it ain't broke, I can fix that.
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

I don't running NIS, NIS+, or LDAP
I run the command as root:
ls -l /etc/group
-r--r--r-- 1 bin 2 1026 Sep 2 11:13 group
If I stop pwgrd, I see the same

I see free space when I run bdf


Roger
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

The problem occurs for all files in the system, including files of operating system
I attach the file /etc/group

Roger
Muthukumar_5
Honored Contributor

Re: ls command show groupid and not groupname

Check your /etc/group file scanning as,

# /usr/sbin/grpck /etc/group

hth.
Easy to suggest when don't know about the problem!
VIKAS AGRAWAL
Frequent Advisor

Re: ls command show groupid and not groupname

Hi Roger ,

I have checked your /etc/group file & i found it look good, but if there is any control character in this file so it might be giving this problem. Please try the following steps
1. cp /etc/group /etc/group.safe
2. cp /usr/newconfig/etc/group /etc/group

As i have seen that u have not deifned any special group so there will not be any problem & after that just reboot the system , Hope it will solve your problem

vikas
Mugilvannan
Valued Contributor

Re: ls command show groupid and not groupname

Plz try to check /etc/group file with grpck. If you don't find any problem then reboot the machine and post the status.
If U need a helping hand, U will find one at the end of your arm
Stephen Keane
Honored Contributor

Re: ls command show groupid and not groupname

What happens if you try

# chown bin:bin /etc/group

Robert-Jan Goossens_1
Honored Contributor

Re: ls command show groupid and not groupname

you do have an entry in the passwd and the group file for bin ?

passwd
bin:*:2:2::/usr/bin:/sbin/sh

group
bin::2:root,bin

Regards,
Robert-Jan
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

If I run chown command :

# chown bin:bin /etc/group
chown: unknown group id bin
Roger
Geoff Wild
Honored Contributor

Re: ls command show groupid and not groupname

Did you un the command grpck?

Also, does this return output:

finger bin

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Stephen Keane
Honored Contributor

Re: ls command show groupid and not groupname

How about

# cat -v /etc/group

Any "funny" characters show up?

Fabio Ettore
Honored Contributor

Re: ls command show groupid and not groupname

Hi,

as Stephen suggested check for bad characters into /etc/group, it sounds like it is corrupted. Otherwise re-take a fresh /etc/group file by

mv /etc/group /tmp/group.OLD
cp /usr/newconfig/etc/group /etc

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

# finger bin
Login name: bin
Directory: /usr/bin Shell: /sbin/sh
Never logged in.
No unread mail
No Plan.


grpck no report errors
Roger
Victor BERRIDGE
Honored Contributor

Re: ls command show groupid and not groupname

Hi,
Do a more /etc/group
you should have as third line something like:
bin::2:root,bin,lp,....


It cannot give the name of the group if it is not in /etc/group...


All the best
Victor
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

I'm thinking reinstall the server
I found the /sbin/ls show correctly but /usr/bin/ls show bad
I think that the problem is in functions getpwnam, getgrnam, etc. in libc
Roger
Stephen Keane
Honored Contributor

Re: ls command show groupid and not groupname

If the stayically linked "ls" in /sbin/ls works, but the dynamically linked version in /usr/binls doesn't, it suggests one of your shared libraries is wrong.

Can you post

# what /usr/lib/libc.2
# what /usr/lib/libdld.2
# what /usr/lib/libcurses.1

Also,

# ldd /usr/bin/ls



Arunvijai_4
Honored Contributor

Re: ls command show groupid and not groupname

Try applying libc patch. You can find the latest patches in ITRC patch database.

-AV
"A ship in the harbor is safe, but that is not what ships are built for"
RogerVI
Regular Advisor

Re: ls command show groupid and not groupname

Thanks all. I think that ocurred a problem at the initial installation or with a patch installation. I'm going reinstall the server
Roger