Shawn Mervin

systemd

systemd is the service manager on the Ubuntu servers I run, which is how long-running services start, restart and log.

Visit systemd.ioAt the command line

What it is

systemd is the init system and service manager used by most modern Linux distributions, including Ubuntu. It is the first process to start at boot, and it starts, stops and supervises everything else. Each service is described in a unit file that says what to run, what it depends on and what to do if it crashes.

Around that core sit related tools: systemctl to control services, journalctl to read their logs, and timers that can run jobs on a schedule. It was started by Lennart Poettering and Kay Sievers and is now standard on Debian, Ubuntu, Fedora and Red Hat systems. Logs from every service land in one journal, which makes it easier to see what failed and when.

How I use it

  • Part of running the Ubuntu instance behind the Rental Pilot API, its MySQL databases and the Node real-time chat server.
  • Listed among the command line tools I use to run servers end to end.
  • Sits under my monitoring: every production system is probed every five minutes and an outage reaches my phone.

systemd is the right tool when a program has to keep running on a Linux server, come back after a reboot and restart itself after a crash. I reach for it because the part of a system that has to still be right at 2am is the part nobody is watching, so it needs a supervisor that is.

Questions

Who keeps your servers running overnight?

I run them myself. Every production system is checked every five minutes from AWS, and an outage reaches my phone.

What does systemd do on a server?

It starts services at boot, restarts them if they crash and collects their logs, so a server recovers on its own instead of waiting for someone to log in.

Working with systemd?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next