sd_booted(3)

sd_booted3

Test whether the system is running the systemd init system

Usage

#include <systemd/sd-daemon.h>

int sd_booted(void);

Overview

sd_booted() checks whether the system was booted up using the systemd init system.

Return value

On failure, this call returns a negative errno-style error code. If the system was booted up with systemd as init system, this call returns a positive return value, zero otherwise.

Notes

Functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file.

Internally, this function checks whether the directory /run/systemd/system/ exists. A simple check like this can also be implemented trivially in shell or any other language.

Releases

8 releases since Debian 7 (Wheezy); the text changed 7 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13
  8. Arch

From systemd-libs 262.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.