sd_booted.xml revision 681eb9cf2b831293a4f3d4c48a748d2e4a25d69e
5065N/A<?xml version='1.0'?> <!--*-nxml-*-->
5065N/A<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
5065N/A "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
5065N/A<!ENTITY % entities SYSTEM "custom-entities.ent" >
5065N/A%entities;
5065N/A]>
5065N/A
5065N/A<!--
5065N/A This file is part of systemd.
5065N/A
6982N/A Copyright 2010 Lennart Poettering
6982N/A
5065N/A systemd is free software; you can redistribute it and/or modify it
5065N/A under the terms of the GNU Lesser General Public License as published by
5065N/A the Free Software Foundation; either version 2.1 of the License, or
5065N/A (at your option) any later version.
6982N/A
6982N/A systemd is distributed in the hope that it will be useful, but
6982N/A WITHOUT ANY WARRANTY; without even the implied warranty of
6982N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5065N/A Lesser General Public License for more details.
5065N/A
5065N/A You should have received a copy of the GNU Lesser General Public License
5065N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
5065N/A-->
5065N/A
5065N/A<refentry id="sd_booted"
5065N/A xmlns:xi="http://www.w3.org/2001/XInclude">
5065N/A
5065N/A <refentryinfo>
5065N/A <title>sd_booted</title>
5065N/A <productname>systemd</productname>
5065N/A
5065N/A <authorgroup>
5065N/A <author>
5065N/A <contrib>Developer</contrib>
5065N/A <firstname>Lennart</firstname>
5065N/A <surname>Poettering</surname>
5065N/A <email>lennart@poettering.net</email>
5065N/A </author>
5065N/A </authorgroup>
5065N/A </refentryinfo>
5065N/A
5065N/A <refmeta>
5065N/A <refentrytitle>sd_booted</refentrytitle>
5065N/A <manvolnum>3</manvolnum>
5065N/A </refmeta>
5065N/A
5065N/A <refnamediv>
5065N/A <refname>sd_booted</refname>
5065N/A <refpurpose>Test whether the system is running the systemd init system</refpurpose>
5065N/A </refnamediv>
5065N/A
5065N/A <refsynopsisdiv>
5065N/A <funcsynopsis>
5065N/A <funcsynopsisinfo>#include &lt;systemd/sd-daemon.h&gt;</funcsynopsisinfo>
5065N/A
5065N/A <funcprototype>
5065N/A <funcdef>int <function>sd_booted</function></funcdef>
5065N/A <paramdef>void</paramdef>
5065N/A </funcprototype>
5065N/A </funcsynopsis>
5065N/A </refsynopsisdiv>
5065N/A
5065N/A <refsect1>
5065N/A <title>Description</title>
5065N/A <para><function>sd_booted()</function> checks whether the system
5065N/A was booted up using the systemd init system.</para>
5065N/A </refsect1>
5065N/A
5065N/A <refsect1>
5065N/A <title>Return Value</title>
5065N/A
5065N/A <para>On failure, this call returns a negative errno-style error
5065N/A code. If the system was booted up with systemd as init system,
5065N/A this call returns a positive return value, zero otherwise.</para>
5065N/A </refsect1>
5065N/A
5065N/A <refsect1>
5065N/A <title>Notes</title>
5065N/A
5065N/A <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
5065N/A
5065N/A <para>Internally, this function checks whether the directory
5065N/A <filename>/run/systemd/system/</filename> exists. A simple check
5065N/A like this can also be implemented trivially in shell or any other
5065N/A language.</para>
5065N/A </refsect1>
5065N/A
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>