1SYSTEMD-NOTIFY(1) systemd-notify SYSTEMD-NOTIFY(1)
2
3
4
6 systemd-notify - Notify init system about start-up completion and other
7 daemon status changes
8
10 systemd-notify [OPTIONS...] [VARIABLE=VALUE...]
11
13 systemd-notify may be called by daemon scripts to notify the init
14 system about status changes. It can be used to send arbitrary
15 information, encoded in an environment-block-like list of strings. Most
16 importantly it can be used for start-up completion notification.
17
18 This is mostly just a wrapper around sd_notify() and makes this
19 functionality available to shell scripts. For details see sd_notify(3).
20
21 The command line may carry a list of environment variables to send as
22 part of the status update.
23
24 Note that systemd will refuse reception of status updates from this
25 command unless NotifyAccess=all is set for the service unit this
26 command is called from.
27
29 The following options are understood:
30
31 --h, --help
32 Prints a short help text and exits.
33
34 --ready
35 Inform the init system about service start-up completion. This is
36 equivalent to systemd-notify READY=1. For details about the
37 semantics of this option see sd_notify(3).
38
39 --pid=
40 Inform the init system about the main PID of the daemon. Takes a
41 PID as argument. If the argument is omitted the PID of the process
42 that invoked systemd-notify is used. This is equivalent to
43 systemd-notify MAINPID=$PID. For details about the semantics of
44 this option see sd_notify(3).
45
46 --status=
47 Send a free-form status string for the daemon to the init systemd.
48 This option takes the status string as argument. This is equivalent
49 to systemd-notify STATUS=.... For details about the semantics of
50 this option see sd_notify(3).
51
52 --booted
53 Returns 0 if the system was booted up with systemd, non-zero
54 otherwise. If this option is passed no message is sent. This option
55 is hence unrelated to the other options. For details about the
56 semantics of this option see sd_booted(3).
57
59 On success 0 is returned, a non-zero failure code otherwise.
60
62 Example 1. Start-up Notification and Status Updates
63
64 A simple shell daemon that sends start-up notifications after having
65 set up its communication channel. During runtime it sends further
66 status updates to the init system:
67
68 #!/bin/bash
69
70 mkfifo /tmp/waldo
71 systemd-notify --ready --status="Waiting for data..."
72
73 while : ; do
74 read a < /tmp/waldo
75 systemd-notify --status="Processing $a"
76
77 # Do something with $a ...
78
79 systemd-notify --status="Waiting for data..."
80 done
81
83 systemd(1), systemctl(1), systemd.unit(5), sd_notify(3), sd_booted(3)
84
86 Lennart Poettering <lennart@poettering.net>
87 Developer
88
89
90
91systemd 09/14/2010 SYSTEMD-NOTIFY(1)