Systemd service failed state?

I entered ‘systemctl --failed’ in the shell as a routine check, and discovered I do have an issue.

$ systemctl --failed UNIT LOAD ACTIVE SUB DESCRIPTION ● shadow.service loaded failed failed Verify integrity of password and group files

I’m not sure how to resolve. I’d appreciate any detailed insturctions with a little explanation so that I understand [and hopefully could work through on my own in the future].

Thanks!

This will tell you what’s causing shadow.service to not load:

systemctl status shadow.service

Please post the output.

I had shutdown and now I’m at my machine again. In the meantime, shadow.service no longer failed although I have not made any changes.

[code]$ systemctl --failed
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use ‘systemctl list-unit-files’.

$ systemctl status shadow.service
● shadow.service - Verify integrity of password and group files
Loaded: loaded (/usr/lib/systemd/system/shadow.service; static; vendor preset: disabled)
Active: inactive (dead)[/code]

Any reason this might have happened, and any suggestions?

I will continue to check for failed systemd services, and if it happens again I’ll run the status and post the results.

Thanks again :slight_smile:

When there is an update for any application or service that uses the shadow.service, a reboot is often required for the system to adjust to the change.

I did receive a shadow.service failure again. So I ran the status and posted results below.

It looks like there is an invalid reference to ‘mysql’. How can I correct this?

Thanks!

[code]$ systemctl status shadow.service
● shadow.service - Verify integrity of password and group files
Loaded: loaded (/usr/lib/systemd/system/shadow.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-04-21 10:35:56 CDT; 2min 12s ago
Process: 1162 ExecStart=/usr/bin/pwck -r (code=exited, status=2)
Main PID: 1162 (code=exited, status=2)

Apr 21 10:35:56 mike-pc systemd[1]: Starting Verify integrity of password and group files…
Apr 21 10:35:56 mike-pc pwck[1162]: user ‘mysql’: directory ‘/var/lib/mysql’ does not exist
Apr 21 10:35:56 mike-pc pwck[1162]: pwck: no changes
Apr 21 10:35:56 mike-pc systemd[1]: shadow.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 21 10:35:56 mike-pc systemd[1]: Failed to start Verify integrity of password and group files.
Apr 21 10:35:56 mike-pc systemd[1]: shadow.service: Unit entered failed state.
Apr 21 10:35:56 mike-pc systemd[1]: shadow.service: Failed with result ‘exit-code’.[/code]

If you don’t have mariadb installed remove the mysql user.

I do not have mariadb installed.

To remove user ‘mysql’ would I simply enter the following as root?

userdel -r mysql

Thanks

Never mind, removing the mysql user can cause other issues.
First check for a /etc/groups.pacnew, pacorig, or pacsave file, there may have been an update to this file.
If so merge any changes, if not then as a fix run “grpck” and “pwck”, enter 'yes" to add the correct entries.

I already removed the mysql user. Does not seem to have caused any problems.

When I run grpck, I get, “cannot lock /etc/group; try again later”, and when I run pwck, I get “cannot lock /etc/passwd; try again later.”

If I run them as root, I do not get any output.

Is that as it should be?

Thanks again.

Yes, those need to be run with elevated privileges (sudo) or as root (su).
And yes, there should not be any output if there are not any issues.