2 .TH "SD_BOOTED" "3" "" "systemd 221" "sd_booted"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 sd_booted \- Test whether the system is running the systemd init system
28 #include <systemd/sd\-daemon\&.h>
31 .HP \w'int\ sd_booted('u
32 .BI "int sd_booted(void);"
36 checks whether the system was booted up using the systemd init system\&.
39 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\&.
42 These APIs are implemented as a shared library, which can be compiled and linked to with the
43 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
46 Internally, this function checks whether the directory
48 exists\&. A simple check like this can also be implemented trivially in shell or any other language\&.