Recently I was asked why use systemd vs sysvinit in embedded systems? There are many discussions on this, and really most of the reasons people use it for servers and desktops are also valid for embedded systems. Lennart Poettering’s articles explain very well why you might want to consider systemd. A few things that rank high on my list:
- systemd systems generally boot must faster than sysvinit systems.
- systemd monitors every process it starts, so you know conclusively if your app is still running.
- systemd has flexible mechanisms for restarting apps that crash, and rebooting if you get so many restarts in X amount of time. This is very important in embedded systems where you need to keep things running.
- systemd logging (journald) is very flexible. The stdout of every process that is started by systemd is captured in the journal. You can also capture kernel messages in the journal. The end result is you have one place to look for system logs.
- systemd has support for watchdog chaining — again, important for many embedded systems.
- The systemd dependency mechanism is very flexible.
- systemd has tools to debug the init process: systemd-analyze, systemd-cgls, systemd-cgtop, bootchart, pybootchargui, etc.
- on demand launch of services can improve boot time and conserve resources.
In summary, with systemd I have more control over the system startup and shutdown, and have better mechanisms to monitor things to make sure they stay running.