Add systemd with tizen patches
[external/systemd.git] / man / systemd-notify.1
1 '\" t
2 .\"     Title: systemd-notify
3 .\"    Author: Lennart Poettering <lennart@poettering.net>
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 02/15/2012
6 .\"    Manual: systemd-notify
7 .\"    Source: systemd
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 systemd-notify \- Notify init system about start\-up completion and other daemon status changes
32 .SH "SYNOPSIS"
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
35 .SH "DESCRIPTION"
36 .PP
37 \fBsystemd\-notify\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\&.
39 .PP
40 This is mostly just a wrapper around
41 \fBsd_notify()\fR
42 and makes this functionality available to shell scripts\&. For details see
43 \fBsd_notify\fR(3)\&.
44 .PP
45 The command line may carry a list of environment variables to send as part of the status update\&.
46 .PP
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\&.
50 .SH "OPTIONS"
51 .PP
52 The following options are understood:
53 .PP
54 \fB\-\-h\fR, \fB\-\-help\fR
55 .RS 4
56 Prints a short help text and exits\&.
57 .RE
58 .PP
59 \fB\-\-ready\fR
60 .RS 4
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
63 \fBsd_notify\fR(3)\&.
64 .RE
65 .PP
66 \fB\-\-pid=\fR
67 .RS 4
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
69 \fBsystemd\-notify\fR
70 is used\&. This is equivalent to
71 \fBsystemd\-notify MAINPID=$PID\fR\&. For details about the semantics of this option see
72 \fBsd_notify\fR(3)\&.
73 .RE
74 .PP
75 \fB\-\-status=\fR
76 .RS 4
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
79 \fBsd_notify\fR(3)\&.
80 .RE
81 .PP
82 \fB\-\-booted\fR
83 .RS 4
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
85 \fBsd_booted\fR(3)\&.
86 .RE
87 .PP
88 \fB\-\-readahead=\fR
89 .RS 4
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)\&.
92 .RE
93 .SH "EXIT STATUS"
94 .PP
95 On success 0 is returned, a non\-zero failure code otherwise\&.
96 .SH "EXAMPLE"
97 .PP
98 \fBExample\ \&1.\ \&Start-up Notification and Status Updates\fR
99 .PP
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:
101 .sp
102 .if n \{\
103 .RS 4
104 .\}
105 .nf
106 #!/bin/bash
107
108 mkfifo /tmp/waldo
109 systemd\-notify \-\-ready \-\-status="Waiting for data\&.\&.\&."
110
111 while : ; do
112         read a < /tmp/waldo
113         systemd\-notify \-\-status="Processing $a"
114
115         # Do something with $a \&.\&.\&.
116
117         systemd\-notify \-\-status="Waiting for data\&.\&.\&."
118 done
119 .fi
120 .if n \{\
121 .RE
122 .\}
123 .SH "SEE ALSO"
124 .PP
125
126 \fBsystemd\fR(1),
127 \fBsystemctl\fR(1),
128 \fBsystemd.unit\fR(5),
129 \fBsd_notify\fR(3),
130 \fBsd_booted\fR(3)
131 .SH "AUTHOR"
132 .PP
133 \fBLennart Poettering\fR <\&lennart@poettering\&.net\&>
134 .RS 4
135 Developer
136 .RE