Advanced · 15 min · practise every command in the built-in terminal

🎯 Mission Briefing: The Service That Won't Stay Up

After last night's upgrade the queue worker stopped processing jobs. systemd keeps restarting it every few seconds — hundreds of times by now — and it dies every single time. Restarting it again won't help; you need the reason.

Your objective

Find out why worker.service crashes, fix the cause without exposing its secrets, and get it running.

Investigation toolkit

systemctl status worker              # "activating (auto-restart)" = a crash loop
journalctl -u worker -n 20           # What does the worker say before it dies?
systemctl cat worker                 # The unit file: what runs, and as which user?
ls -l /etc/worker/                   # Who owns the config, who may read it?
id worker                            # Which groups is the service user in?

Fix and verify

sudo chown worker /etc/worker/config.yml     # Give the file to the service's user
# (or: sudo chgrp worker … && sudo chmod 640 …)
sudo systemctl restart worker
systemctl status worker

💡 The config holds a password — don't fix this with chmod 644, which would let every user read it. Give access to exactly the user who needs it.

Practice tasks

  1. Check the state of the worker service
  2. Find the error in the worker's logs
  3. Find out which user the service runs as
  4. Let the worker user read its config — but keep it secret from everyone else
  5. Get the worker running

Missions