The lab-worker report service ran as root, although it has no need for root. A colleague fixed the unit file, which now says User=student, and wrote: "done". Check which user the service runs as.
Who runs lab-worker
Read the lab-worker unit file, see which user the service's process (the sleep program) runs as, and read the service summary.
First, predict
The unit file says User=student. What will ps print in the USER column for the sleep process?
Now start the exercise, run the command and compare your prediction with the output.
Why does the lab-worker process run as root although the unit file says User=student?
-
The summary asks for
systemctl daemon-reload, the command that rereads unit files, rather than for a reboot. -
systemd works with this file: its path is on the summary's
Loadedline, and the warning at the end says the file has changed. -
systemd starts services as the user named in the loaded description. The summary points elsewhere: the file has changed and needs reloading.
The process was started from the old description with User=root, and systemd has not reread the new file yet, which is what the summary warns about.