Linux Labs

Packages, services, and logs / Stage 8 of 13

Your own service unit and applying changes

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 7 · on a machine · 6 min

Apply the change

Here the change from the start of the lesson reaches the process. The file is already fixed; what is left is to apply it and check the process before the restart and after it. All the commands are on the card, each with its own run button.

Exercise · do it

Carry the change to the process

The lab-worker file already says User=student, but the service's process runs as root. Make sleep 86400 run as student. Do not change the unit file, and do not enable autostart.

First, predict

After daemon-reload, who will the sleep process run as?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Get the service's process running as student not done yet
  • Leave the file and autostart as they are not done yet

The order is the same for any change to a unit file: daemon-reload, then a restart of the service and a check of the live process, with ps or the Main PID line of systemctl status. Checking the file alone would miss what you saw at the start of the lesson.

Step goals

0 of 2
  • Get the service's process running as student — not done yet
  • Leave the file and autostart as they are — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Get the service's process running as student — not done yet
  • Leave the file and autostart as they are — not done yet
Loading…