chiark / gitweb /
man: document systemd-notify
[elogind.git] / man / systemd-notify.xml
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">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2010 Lennart Poettering
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU General Public License as published by
12   the Free Software Foundation; either version 2 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-notify">
25
26         <refentryinfo>
27                 <title>systemd-notify</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd-notify</refentrytitle>
42                 <manvolnum>1</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd-notify</refname>
47                 <refpurpose>Notify init system about start-up completion and other daemon status changes</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <cmdsynopsis>
52                         <command>systemd-notify <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt" rep="repeat">VARIABLE=VALUE</arg></command>
53                 </cmdsynopsis>
54         </refsynopsisdiv>
55
56         <refsect1>
57                 <title>Description</title>
58
59                 <para><command>systemd-notify</command> may be
60                 called by daemon scripts to notify the init system
61                 about status changes. It can be used to send arbitrary
62                 information, encoded in an environment-block-like list
63                 of strings. Most importantly it can be used for
64                 start-up completion notification.</para>
65
66                 <para>This is mostly just a wrapper around
67                 <function>sd_notify()</function> and makes this
68                 functionality available to shell scripts. For details
69                 see
70                 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
71
72                 <para>The command line may carry a list of
73                 environment variables to send as part of the status
74                 update.</para>
75
76         </refsect1>
77
78         <refsect1>
79                 <title>Options</title>
80
81                 <para>The following options are understood:</para>
82
83                 <variablelist>
84                         <varlistentry>
85                                 <term><option>--h</option></term>
86                                 <term><option>--help</option></term>
87
88                                 <listitem><para>Prints a short help
89                                 text and exits.</para></listitem>
90                         </varlistentry>
91
92                         <varlistentry>
93                                 <term><option>--ready</option></term>
94
95                                 <listitem><para>Inform the init system
96                                 about service start-up
97                                 completion. This is equivalent to
98                                 <command>systemd-notify
99                                 READY=1</command>. For details about
100                                 the semantics of this option see
101                                 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
102                         </varlistentry>
103
104                         <varlistentry>
105                                 <term><option>--pid=</option></term>
106
107                                 <listitem><para>Inform the init system
108                                 about the main PID of the
109                                 daemon. Takes a PID as argument. If
110                                 the argument is omitted the PID of the
111                                 process that invoked
112                                 <command>systemd-notify</command> is
113                                 used. This is equivalent to
114                                 <command>systemd-notify
115                                 MAINPID=$PID</command>. For details
116                                 about the semantics of this option see
117                                 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
118                         </varlistentry>
119
120                         <varlistentry>
121                                 <term><option>--status=</option></term>
122
123                                 <listitem><para>Send a free-form
124                                 status string for the daemon to the
125                                 init systemd. This option takes the
126                                 status string as argument. This is
127                                 equivalent to <command>systemd-notify
128                                 STATUS=...</command>. For details
129                                 about the semantics of this option see
130                                 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
131                         </varlistentry>
132
133                         <varlistentry>
134                                 <term><option>--booted</option></term>
135
136                                 <listitem><para>Returns 0 if the
137                                 system was booted up with systemd,
138                                 non-zero otherwise. If this option is
139                                 passed no message is sent. This option
140                                 is hence unrelated to the other
141                                 options. For details about the
142                                 semantics of this option see
143                                 <citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
144                         </varlistentry>
145                 </variablelist>
146
147         </refsect1>
148
149         <refsect1>
150                 <title>Exit status</title>
151
152                 <para>On success 0 is returned, a non-zero failure
153                 code otherwise.</para>
154         </refsect1>
155
156         <refsect1>
157                 <title>See Also</title>
158                 <para>
159                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
160                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
161                         <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
162                         <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
163                         <citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>
164                 </para>
165         </refsect1>
166
167 </refentry>