You are not logged in.

#1 2014-07-08 08:56:41

n125
Member
Registered: 2011-12-30
Posts: 38

pwck Complaining about homeless users, causing shadow.service to fail

I was looking through my journal and noticed the following error:

Jul 08 00:00:00 raspberry_pi systemd[1]: Failed to start Verify integrity of password and group files.

Checking the status of shadow.service produces this output:

~ $ sudo systemctl status -l shadow                                                                                     
● shadow.service - Verify integrity of password and group files
   Loaded: loaded (/usr/lib/systemd/system/shadow.service; static)
   Active: failed (Result: exit-code) since Tue 2014-07-08 00:00:00 PDT; 5min ago
  Process: 11736 ExecStart=/usr/bin/pwck -r (code=exited, status=2)
 Main PID: 11736 (code=exited, status=2)

Jul 08 00:00:00 raspberry_pi systemd[1]: Starting Verify integrity of password and group files...
Jul 08 00:00:00 raspberry_pi pwck[11736]: user 'remote': directory '/home/remote' does not exist
Jul 08 00:00:00 raspberry_pi systemd[1]: shadow.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 08 00:00:00 raspberry_pi systemd[1]: Failed to start Verify integrity of password and group files.
Jul 08 00:00:00 raspberry_pi systemd[1]: Unit shadow.service entered failed state.
Jul 08 00:00:01 raspberry_pi pwck[11736]: pwck: no changes

The passwd entry for this user is

~ $ cat /etc/passwd
[...]
remote:x:1001:100::/home/remote:/bin/nologin

I guess this explains why pwck is complaining and causing shadow.service to fail. However, this user was created a long time ago, explicitly without a home directory, so I am not sure why a home path is specified in the passwd file. I also feel certain that this error is relatively new.

So, using the following command I created a test user without a home directory so that I could at least see what a passwd line for a user without a home directory is supposed to look like, but to my surprise a home path was specified in the passwd file and pwck complained about the new user in the same way.

~ $ sudo useradd -M -g users -s /bin/bash testuser
~ $ cat /etc/passwd
[...]
testuser:x:1002:100::/home/testuser:/bin/bash
~ $ sudo pwck -r
user 'remote': directory '/home/remote' does not exist
user 'testuser': directory '/home/testuser' does not exist
pwck: no changes

I also created a throwaway user on my x86 notebook to see if this happens, and it does, so this does not appear to be related to the architecture.

Is there anything I could do short of creating a home directory for this user, or does this look like a bug?

Offline

#2 2014-11-05 15:16:28

zomernifalt
Member
Registered: 2014-11-05
Posts: 1

Re: pwck Complaining about homeless users, causing shadow.service to fail

Hope it's not too late to answer this.
Changing the home directory to /dev/null seems to have solved the issue for me.
Still don't know what negative effects that might have for me, but shadow.service runs normally as far as I can tell.

Edit:
Performing

userdel -r <user>

throws

userdel: /dev/null not owned by <user>, not removing

, so setting /dev/null as the home directory is relatively "safe"

Last edited by zomernifalt (2014-11-05 15:55:36)

Offline

Board footer

Powered by FluxBB