Systemd-sysusers.service Unit fails to start on a VPS

debianlinuxsystemd

I am trying to troubleshoot my systemd-sysusers.service but I don't know where to start.
First off a bit of background this is running Debian 10 on a VPS which uses Solaris VM among other technology

The unit is failing to start due to


? systemd-sysusers.service - Create System Users                                                                                             
   Loaded: loaded (/lib/systemd/system/systemd-sysusers.service; static; vendor preset: enabled)                                             
   Active: failed (Result: exit-code) since Thu 2021-08-05 08:39:41 EDT; 3s ago                                                              
     Docs: man:sysusers.d(5)                                                                                                                 
           man:systemd-sysusers.service(8)                                                                                                   
  Process: 29802 ExecStart=/bin/systemd-sysusers (code=exited, status=1/FAILURE)                                                             
 Main PID: 29802 (code=exited, status=1/FAILURE)                                                                                             
                                                                                                                                             
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Creating group floppy with gid 25.                                                  
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Creating group audio with gid 29.                                                   
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Creating group dip with gid 30.                                                     
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Creating group video with gid 44.                                                   
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Creating group plugdev with gid 46.                                                 
Aug 05 08:39:41 myvps systemd-sysusers[29802]: /etc/gshadow: Group "cdrom" already exists.                                         
Aug 05 08:39:41 myvps systemd-sysusers[29802]: Failed to write files: File exists                                                  
Aug 05 08:39:41 myvps systemd[1]: systemd-sysusers.service: Main process exited, code=exited, status=1/FAILURE                     
Aug 05 08:39:41 myvps systemd[1]: systemd-sysusers.service: Failed with result 'exit-code'.                                        
Aug 05 08:39:41 myvps systemd[1]: Failed to start Create System Users.

The fact is that if I check sudo vi /etc/gshadow I just get a line regarding to cdrom

cdrom:*::debianuser

But Despite that I don't really have a clue on how to continue

Best Answer

systemd-sysusers expects the /etc/passwd & /etc/shadow, and similarly /etc/group & /etc/gshadow, files to be in sync with each other. If a group is missing, then it should be missing from both of those files. So when sysusers is adding a group that "doesn't exist" but finds it already present in /etc/gshadow, it reports this as an error.

Either manually add the group with groupadd so that it exists in both files, or manually remove it from /etc/gshadow so that systemd-sysusers will be able to properly re-add it, or use grpck to automatically fix all inconsistencies across both files.

Related Question