2 .\" Title: systemd-notify
3 .\" Author: Lennart Poettering <lennart@poettering.net>
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6 .\" Manual: systemd-notify
10 .TH "SYSTEMD\-NOTIFY" "1" "02/15/2012" "systemd" "systemd-notify"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 systemd-notify \- Notify init system about start\-up completion and other daemon status changes
33 .HP \w'\fBsystemd\-notify\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB[VARIABLE=VALUE...]\fR\ 'u
34 \fBsystemd\-notify \fR\fB[OPTIONS...]\fR\fB \fR\fB[VARIABLE=VALUE...]\fR
38 may be called by daemon scripts to notify the init system about status changes\&. It can be used to send arbitrary information, encoded in an environment\-block\-like list of strings\&. Most importantly it can be used for start\-up completion notification\&.
40 This is mostly just a wrapper around
42 and makes this functionality available to shell scripts\&. For details see
45 The command line may carry a list of environment variables to send as part of the status update\&.
47 Note that systemd will refuse reception of status updates from this command unless
48 \fINotifyAccess=all\fR
49 is set for the service unit this command is called from\&.
52 The following options are understood:
54 \fB\-\-h\fR, \fB\-\-help\fR
56 Prints a short help text and exits\&.
61 Inform the init system about service start\-up completion\&. This is equivalent to
62 \fBsystemd\-notify READY=1\fR\&. For details about the semantics of this option see
68 Inform the init system about the main PID of the daemon\&. Takes a PID as argument\&. If the argument is omitted the PID of the process that invoked
70 is used\&. This is equivalent to
71 \fBsystemd\-notify MAINPID=$PID\fR\&. For details about the semantics of this option see
77 Send a free\-form status string for the daemon to the init systemd\&. This option takes the status string as argument\&. This is equivalent to
78 \fBsystemd\-notify STATUS=\&.\&.\&.\fR\&. For details about the semantics of this option see
84 Returns 0 if the system was booted up with systemd, non\-zero otherwise\&. If this option is passed no message is sent\&. This option is hence unrelated to the other options\&. For details about the semantics of this option see
90 Controls disk read\-ahead operations\&. The argument must be a string, and either "cancel", "done" or "noreplay"\&. For details about the semantics of this option see
91 \fBsd_readahead\fR(3)\&.
95 On success 0 is returned, a non\-zero failure code otherwise\&.
98 \fBExample\ \&1.\ \&Start-up Notification and Status Updates\fR
100 A simple shell daemon that sends start\-up notifications after having set up its communication channel\&. During runtime it sends further status updates to the init system:
109 systemd\-notify \-\-ready \-\-status="Waiting for data\&.\&.\&."
113 systemd\-notify \-\-status="Processing $a"
115 # Do something with $a \&.\&.\&.
117 systemd\-notify \-\-status="Waiting for data\&.\&.\&."
128 \fBsystemd.unit\fR(5),
133 \fBLennart Poettering\fR <\&lennart@poettering\&.net\&>