Interview Prep/Shell Scripting/Troubleshooting: cron and systemd timers

A new service fails instantly with `status=217/USER` and the journal says `Failed to determine user credentials: No such process`.

BeginnerTroubleshootingTroubleshooting: cron and systemd timers
Answer

Likely causes → User=opskit (or Group=) names an account that does not exist on this host. The playbook created the unit before the user, or the user was created on a different host.

Diagnose →

systemctl cat opskit-backup | grep -E '^(User|Group)='
getent passwd opskit || echo "no such user"

Fix → Create a system account, then restart:

useradd --system --home-dir /var/lib/opskit --shell /usr/sbin/nologin opskit
systemctl restart opskit-backup.service

Or use DynamicUser=yes for services that need no persistent identity (combine with StateDirectory= for writable state).

Prevent → Order user creation before unit installation in config management, or ship a sysusers.d file (u opskit - "opskit service" /var/lib/opskit) so systemd-sysusers creates it.

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on Troubleshooting: cron and systemd timers