sd_booted − Test whether the system is running the systemd init system.


#include "sd−daemon.h"

int sd_booted(void);


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


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.


This function is provided by the reference implementation of APIs for new−style daemons and distributed with the systemd package. The algorithm it implements is simple, and can easily be reimplemented in daemons if it is important to support this interface without using the reference implementation.

Internally, this function checks whether the /sys/fs/cgroup/systemd virtual file system is mounted, by comparing the st_dev value of the stat() data of /sys/fs/cgroup and /sys/fs/cgroup/systemd.

For details about the algorithm check the liberally licensed reference implementation sources: resp.

sd_booted() is implemented in the reference implementation's sd−daemon.c and sd−daemon.h files. These interfaces are available as shared library, which can be compiled and linked to with the libsystemd−daemon pkg-config(1) file. Alternatively, applications consuming these APIs may copy the implementation into their source tree. For more details about the reference implementation see sd_daemon(7).

If the reference implementation is used as drop−in files and −DDISABLE_SYSTEMD is set during compilation this function will always return 0 and otherwise become a NOP.


systemd(1), sd_daemon(7)


Lennart Poettering <>


More Linux Commands

XtAddInput(3) - register input, timeout, and workprocs......
XtAddInput has been replaced by XtAppAddInput. XtAddTimeOut has been replaced by XtAppAddTimeOut. XtAddWorkProc has been replaced by XtAppAddWorkProc. SEE ALSO

mmove(1) - move or rename an MSDOS file or subdirectory.....
The mmove command is used to moves or renames an existing MS-DOS file or subdirectory. mmove [-v] [-D clash_option] sourcefile targetfile mmove [-v] [-D clash_o

opendir(3) - open a directory (Library - Linux man page)....
The opendir() function opens a directory stream corresponding to the directory name, and returns a pointer to the directory stream. The stream is positioned at

glArrayElement(3gl) - render a vertex using the specified ve
glArrayElement commands are used within glBegin/glEnd pairs to specify vertex and attribute data for point, line, and polygon primitives. If GL_VERTEX_ARRAY is

ripd(8) - a RIP routing engine for use with Quagga routing s
ripd is a routing component that works with the Quagga routing engine. OPTIONS Options available for the ripd command: OPTIONS -d, --daemon Runs in daemon mode,

keyctl_instantiate(3) - Instantiate a key from flat data....
keyctl_assume_authority() assumes the authority for the calling thread to deal with and instantiate the specified uninstantiated key. The calling thread must ha

ber_free(3) - OpenLDAP LBER types and allocation functions
The following are the basic types and structures defined for use with the Lightweight BER library. ber_int_t is a signed integer of at least 32 bits. It is comm

encrypt(3) - encrypt 64-bit messages - Linux manual page....
These functions encrypt and decrypt 64-bit messages. The setkey() function sets the key used by encrypt(). The key argument used here is an array of 64 bytes, e

access(2) - check real user's permissions for a file........
access() checks whether the calling process can access the file pathname. If pathname is a symbolic link, it is dereferenced. The mode specifies the accessibili

gluTessNormal(3gl) - specify a normal for a polygon.........
gluTessNormal describes a normal for a polygon that the program is defining. All input data will be projected onto a plane perpendicular to one of the three coo

execvp(3) - execute a file (Library - Linux man page).......
The exec() family of functions replaces the current process image with a new process image. The functions described in this manual page are front-ends for execv

voodoo(4) - Voodoo video driver (Special - Linux man page)
voodoo is an Xorg driver for Voodoo 1 and Voodoo 2 series video adapters. On the Voodoo 1 the driver uses a shadow buffer in system memory as the video adapter

We can't live, work or learn in freedom unless the software we use is free.