1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
8 Copyright 2010 Lennart Poettering
11 <refentry id="sd_booted"
12 xmlns:xi="http://www.w3.org/2001/XInclude">
15 <title>sd_booted</title>
16 <productname>systemd</productname>
20 <contrib>Developer</contrib>
21 <firstname>Lennart</firstname>
22 <surname>Poettering</surname>
23 <email>lennart@poettering.net</email>
29 <refentrytitle>sd_booted</refentrytitle>
30 <manvolnum>3</manvolnum>
34 <refname>sd_booted</refname>
35 <refpurpose>Test whether the system is running the systemd init system</refpurpose>
40 <funcsynopsisinfo>#include <systemd/sd-daemon.h></funcsynopsisinfo>
43 <funcdef>int <function>sd_booted</function></funcdef>
44 <paramdef>void</paramdef>
50 <title>Description</title>
51 <para><function>sd_booted()</function> checks whether the system
52 was booted up using the systemd init system.</para>
56 <title>Return Value</title>
58 <para>On failure, this call returns a negative errno-style error
59 code. If the system was booted up with systemd as init system,
60 this call returns a positive return value, zero otherwise.</para>
66 <xi:include href="libelogind-pkgconfig.xml" xpointer="pkgconfig-text"/>
68 <para>Internally, this function checks whether the directory
69 <filename>/run/systemd/system/</filename> exists. A simple check
70 like this can also be implemented trivially in shell or any other
75 <title>See Also</title>
77 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
78 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>