DevOps and cloud

Stage 1 · Lesson 4 of 10

Services with systemd

Linux, the shell and scripting

is the program that starts and looks after services on most systems. A service is a program that runs in the background, such as a web server. You control services with systemctl: start, stop, restart, enable (start at boot) and status.

Each service is described by a small text file called a unit file. It says which command to run, which user to run it as and what to do if it crashes, for example Restart=on-failure. Writing your own unit file turns a script or app into something that survives crashes and reboots.

restart policies and Deployments do the same job later, at larger scale. When a service fails, systemctl status shows its last log lines and its .

Common trapstarting apps with nohup or inside a screen session, which works until the server reboots and nothing comes back.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

Keep handy

  • The handful of flags people actually use for each command, one line each

Also worth your time

Mark this stage as not done?