Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to find the init system used by Linux

📅 2017-Nov-07 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ init, systemd, upstart ⬩ 📚 Archive

init is the first process that is started by an Unix operating system. It has PID 1 and handles creation of all other processes and daemon processes required by the OS. It acts as the ancestor of all processes. There are many init systems that have been used in Linux distributions over the years. Some of the popular init systems are the classic System V init, upstart (Ubuntu used to use this) and systemd (popular right now for all Linux distros).

So, you are sitting at a Linux computer, do you know which init system it is using? There is no straightforward method to find this out.

Here are a few methods, one of which should work:

$ init --version
init (upstart 1.12.1)
Copyright (C) 2006-2014 Canonical Ltd., 2011 Scott James Remnant

This was on a Ubuntu 14.04 system. You can see that it uses upstart.

$ stat /sbin/init
  File: '/sbin/init' -> '/lib/systemd/systemd'

This was on a Ubuntu 16.04 system. You can see that it uses systemd.


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧