# User simultaneously exists and yet does not.



## SanPollo (Oct 13, 2013)

Hi there,

I just installed gdm on a machine that I recently upgraded from 9.1 to 9.2 by following Chapter 24 of the FreeBSD Handbook.

To the best of my knowledge, when gdm is installed it creates both a group and a user called gdm. I can confirm that this user exists in /etc/groups /etc/passwd and /etc/master.passwd however it cannot be 'fingered' whereas the avahi, haldaemon, pulse and polkit users can.

When I attempt to start the dbus service it complains that there is no gdm user.

```
root@smudge:~ # service dbus start
Starting dbus.
Unknown username "gdm" in message bus configuration file
root@smudge:~ #
```
So as I said I can't 'finger' the user so I decided something wasn't right and that I would remove the user and re-add it. Unfortunately the following happened:


```
root@smudge:~ # pw userdel gdm
pw: no such user 'gdm'
root@smudge:~ # pw useradd gdm -u 92 -g 92 -d /nonexistent -s /sbin/nologin -c "GNOME Display Manager"
pw: user 'gdm' already exists
root@smudge:~ #
```
I can happily remove and add back the gdm group using pw but not the user. I have tried uninstalling the gdm port, then trying to remove the user but I get the same message about the user not existing.

I don't understand how a user can exist and not exist at the same time. I know Halloween is coming up soon but I could do without a ghoulish gdm user! ï¿½e

If anyone could help me to exorcise this user and solve my problem I would be very grateful.

SanPollo


----------



## SirDice (Oct 14, 2013)

I've had that happen on a few systems too, not specifically with this user but with others. The quick solution is to try vipw(8), edit the passwd file but don't make any changes. Then exit. That should 'reset' the passwd database and hopefully the user will truly exist again.


----------



## ShelLuser (Oct 14, 2013)

Or in short: you'll want pwd_mkdb. This command creates or updates the password databases, and it could be preferable to use because it gives you more control (the only reason I still know this command from mind is because I've used it when upgrading my servers).

This seems like a mismatch between passwd and the underlying database.


----------



## SanPollo (Oct 14, 2013)

Hi guys,

Thanks very much for this, guys. I ran `vipw` and saved without any changes which seemed to fix the issue. I've been looking into this a bit more and have at least learnt a bit about vipw running its own checks before calling pwd_mkdb to update the user database.

Thanks again.


----------



## mix_room (Nov 1, 2013)

I just wanted to mention that I just successfully used vipw to solve the same problem. The solution seems to work.


----------

