sd_notify.xml revision af62c704053b5d34672497eb5bdc4764ebbb5f4f
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
97a9a944b5887e91042b019776c41d5dd74557aferikabele "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is part of systemd.
b686b6a420bde7f78c416b90be11db94cb789979nd Copyright 2010 Lennart Poettering
b686b6a420bde7f78c416b90be11db94cb789979nd systemd is free software; you can redistribute it and/or modify it
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen under the terms of the GNU General Public License as published by
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the Free Software Foundation; either version 2 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
b686b6a420bde7f78c416b90be11db94cb789979nd systemd is distributed in the hope that it will be useful, but
b686b6a420bde7f78c416b90be11db94cb789979nd WITHOUT ANY WARRANTY; without even the implied warranty of
b686b6a420bde7f78c416b90be11db94cb789979nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b686b6a420bde7f78c416b90be11db94cb789979nd General Public License for more details.
b686b6a420bde7f78c416b90be11db94cb789979nd You should have received a copy of the GNU General Public License
b686b6a420bde7f78c416b90be11db94cb789979nd along with systemd; If not, see <http://www.gnu.org/licenses/>.
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd <refentryinfo>
f3ec420152ca921e4c1ce77782f51b53f659018dnd <authorgroup>
b686b6a420bde7f78c416b90be11db94cb789979nd </authorgroup>
b686b6a420bde7f78c416b90be11db94cb789979nd </refentryinfo>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf </refmeta>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen <refnamediv>
b686b6a420bde7f78c416b90be11db94cb789979nd <refpurpose>Notify init system about start-up completion and other daemon status changes</refpurpose>
b686b6a420bde7f78c416b90be11db94cb789979nd </refnamediv>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <refsynopsisdiv>
b686b6a420bde7f78c416b90be11db94cb789979nd <funcsynopsis>
b686b6a420bde7f78c416b90be11db94cb789979nd <funcsynopsisinfo>#include "sd-daemon.h"</funcsynopsisinfo>
b686b6a420bde7f78c416b90be11db94cb789979nd <funcprototype>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen <funcdef>int <function>sd_notify</function></funcdef>
b686b6a420bde7f78c416b90be11db94cb789979nd <paramdef>int <parameter>unset_environment</parameter></paramdef>
b686b6a420bde7f78c416b90be11db94cb789979nd <paramdef>const char *<parameter>state</parameter></paramdef>
b686b6a420bde7f78c416b90be11db94cb789979nd </funcprototype>
b686b6a420bde7f78c416b90be11db94cb789979nd <funcprototype>
b686b6a420bde7f78c416b90be11db94cb789979nd <paramdef>int <parameter>unset_environment</parameter></paramdef>
b686b6a420bde7f78c416b90be11db94cb789979nd <paramdef>const char *<parameter>format</parameter></paramdef>
b686b6a420bde7f78c416b90be11db94cb789979nd </funcprototype>
b686b6a420bde7f78c416b90be11db94cb789979nd </funcsynopsis>
b686b6a420bde7f78c416b90be11db94cb789979nd </refsynopsisdiv>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf by a daemon to notify the init system about status
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen changes. It can be used to send arbitrary information,
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd encoded in an environment-block-like string. Most
e487d6c09669296f94a5190cc34586a98e624a00nd importantly it can be used for start-up completion
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd notification.</para>
b686b6a420bde7f78c416b90be11db94cb789979nd environment variable before returning (regardless
b686b6a420bde7f78c416b90be11db94cb789979nd whether the function call itself succeeded or
b686b6a420bde7f78c416b90be11db94cb789979nd not). Further calls to
b686b6a420bde7f78c416b90be11db94cb789979nd the variable is no longer inherited by child
b686b6a420bde7f78c416b90be11db94cb789979nd processes.</para>
b686b6a420bde7f78c416b90be11db94cb789979nd should contain an newline-seperated list of variable
b686b6a420bde7f78c416b90be11db94cb789979nd assignments, similar in style to an environment
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf block. A trailing newline is implied if none is
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen specified. The string may contain any kind of variable
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd assignments, but the following shall be considered
e487d6c09669296f94a5190cc34586a98e624a00nd well-known:</para>
17ade6df5ec233536985eb1c130a906c725dd614humbedooh <variablelist>
e487d6c09669296f94a5190cc34586a98e624a00nd <varlistentry>
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener that daemon startup is finished. This
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener is only used by systemd if the service
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf definition file has Type=notify
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener set. The passed argument is a boolean
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener "1" or "0". Since there is little
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener value in signalling non-readiness, the
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf only value daemons should send is
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen </varlistentry>
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen <varlistentry>
b686b6a420bde7f78c416b90be11db94cb789979nd status string back to the init system
b686b6a420bde7f78c416b90be11db94cb789979nd that describes the daemon state. This
b686b6a420bde7f78c416b90be11db94cb789979nd is free-form and can be used for
b686b6a420bde7f78c416b90be11db94cb789979nd various purposes: general state
b686b6a420bde7f78c416b90be11db94cb789979nd feedback, fsck-like programs could
b686b6a420bde7f78c416b90be11db94cb789979nd pass completion percentages and
b686b6a420bde7f78c416b90be11db94cb789979nd failing programs could pass a human
b686b6a420bde7f78c416b90be11db94cb789979nd readable error message. Example:
b686b6a420bde7f78c416b90be11db94cb789979nd "STATUS=Completed 66% of file system
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen </varlistentry>
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd <varlistentry>
e487d6c09669296f94a5190cc34586a98e624a00nd errno-style error code, formatted as
b686b6a420bde7f78c416b90be11db94cb789979nd string. Example: "ERRNO=2" for
b686b6a420bde7f78c416b90be11db94cb789979nd </varlistentry>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <varlistentry>
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung D-Bus error-style error code. Example:
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd "BUSERROR=org.freedesktop.DBus.Error.TimedOut"</para></listitem>
5effc8b39fae5cd169d17f342bfc265705840014rbowen </varlistentry>
2c9e74eac9f72c14535dd65a520e4de2e664d9cdhumbedooh <varlistentry>
b686b6a420bde7f78c416b90be11db94cb789979nd daemon, in case the init system did