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 7 of 7 · summary · 2 min

Summary

  • A unit file is settings made of the [Unit], [Service] and [Install] sections. systemd runs ExecStart without a shell, User names the user, Restart says when to start again.
  • A change passes through three places: the file on disk, the description in systemd after daemon-reload, and the process after a new start.
  • User and ExecStart reach only a new process, so the service is restarted after they change. systemd applies Restart right after daemon-reload.
  • At the start of the lesson lab-worker ran as root: User=student was written to the file, but the description was not reloaded and the service was not restarted.
Ubuntu 24.04
Loading…