]>
Commit | Line | Data |
---|---|---|
f9378423 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
f9378423 LP |
4 | |
5 | <!-- | |
572eb058 ZJS |
6 | SPDX-License-Identifier: LGPL-2.1+ |
7 | ||
f9378423 LP |
8 | This file is part of systemd. |
9 | ||
10 | Copyright 2010 Lennart Poettering | |
11 | ||
12 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
13 | under the terms of the GNU Lesser General Public License as published by |
14 | the Free Software Foundation; either version 2.1 of the License, or | |
f9378423 LP |
15 | (at your option) any later version. |
16 | ||
17 | systemd is distributed in the hope that it will be useful, but | |
18 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 20 | Lesser General Public License for more details. |
f9378423 | 21 | |
5430f7f2 | 22 | You should have received a copy of the GNU Lesser General Public License |
f9378423 LP |
23 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
24 | --> | |
25 | ||
6a70f3aa | 26 | <refentry id="sd_booted" |
798d3a52 ZJS |
27 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
28 | ||
29 | <refentryinfo> | |
30 | <title>sd_booted</title> | |
31 | <productname>systemd</productname> | |
32 | ||
33 | <authorgroup> | |
34 | <author> | |
35 | <contrib>Developer</contrib> | |
36 | <firstname>Lennart</firstname> | |
37 | <surname>Poettering</surname> | |
38 | <email>lennart@poettering.net</email> | |
39 | </author> | |
40 | </authorgroup> | |
41 | </refentryinfo> | |
42 | ||
43 | <refmeta> | |
44 | <refentrytitle>sd_booted</refentrytitle> | |
45 | <manvolnum>3</manvolnum> | |
46 | </refmeta> | |
47 | ||
48 | <refnamediv> | |
49 | <refname>sd_booted</refname> | |
50 | <refpurpose>Test whether the system is running the systemd init system</refpurpose> | |
51 | </refnamediv> | |
52 | ||
53 | <refsynopsisdiv> | |
54 | <funcsynopsis> | |
55 | <funcsynopsisinfo>#include <systemd/sd-daemon.h></funcsynopsisinfo> | |
56 | ||
57 | <funcprototype> | |
58 | <funcdef>int <function>sd_booted</function></funcdef> | |
59 | <paramdef>void</paramdef> | |
60 | </funcprototype> | |
61 | </funcsynopsis> | |
62 | </refsynopsisdiv> | |
63 | ||
64 | <refsect1> | |
65 | <title>Description</title> | |
66 | <para><function>sd_booted()</function> checks whether the system | |
67 | was booted up using the systemd init system.</para> | |
68 | </refsect1> | |
69 | ||
70 | <refsect1> | |
71 | <title>Return Value</title> | |
72 | ||
73 | <para>On failure, this call returns a negative errno-style error | |
74 | code. If the system was booted up with systemd as init system, | |
75 | this call returns a positive return value, zero otherwise.</para> | |
76 | </refsect1> | |
77 | ||
78 | <refsect1> | |
79 | <title>Notes</title> | |
80 | ||
81 | <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/> | |
82 | ||
83 | <para>Internally, this function checks whether the directory | |
84 | <filename>/run/systemd/system/</filename> exists. A simple check | |
85 | like this can also be implemented trivially in shell or any other | |
86 | language.</para> | |
87 | </refsect1> | |
88 | ||
89 | <refsect1> | |
90 | <title>See Also</title> | |
91 | <para> | |
92 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
93 | <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
94 | </para> | |
95 | </refsect1> | |
f9378423 LP |
96 | |
97 | </refentry> |