X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=man%2Fsystemd-notify.xml;h=684f490099c831459f6aa380eeb0b884e17ee40d;hp=46f3f1afaf6a82f741cb3007cb2a483e806276d2;hb=baade8cc237c37bd8905d86ec6e9c7872d4abe03;hpb=c5abba08873903d80a2dcdd46aace959fcae1b0f diff --git a/man/systemd-notify.xml b/man/systemd-notify.xml index 46f3f1afa..684f49009 100644 --- a/man/systemd-notify.xml +++ b/man/systemd-notify.xml @@ -8,20 +8,21 @@ Copyright 2010 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . --> - + systemd-notify @@ -44,7 +45,7 @@ systemd-notify - Notify init system about start-up completion and other daemon status changes + Notify service manager about start-up completion and other daemon status changes @@ -73,6 +74,11 @@ environment variables to send as part of the status update. + Note that systemd will refuse reception of + status updates from this command unless + NotifyAccess=all is set for the + service unit this command is called from. + @@ -81,14 +87,6 @@ The following options are understood: - - - - - Prints a short help - text and exits. - - @@ -107,7 +105,7 @@ 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 + the argument is omitted, the PID of the process that invoked systemd-notify is used. This is equivalent to @@ -136,12 +134,15 @@ Returns 0 if the system was booted up with systemd, non-zero otherwise. If this option is - passed no message is sent. This option + passed, no message is sent. This option is hence unrelated to the other options. For details about the - semantics of this option see + semantics of this option, see sd_booted3. + + + @@ -149,10 +150,38 @@ Exit status - On success 0 is returned, a non-zero failure + On success, 0 is returned, a non-zero failure code otherwise. + + Example + + + Start-up Notification and Status Updates + + 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: + + #!/bin/bash + +mkfifo /tmp/waldo +systemd-notify --ready --status="Waiting for data..." + +while : ; do + read a < /tmp/waldo + systemd-notify --status="Processing $a" + + # Do something with $a ... + + systemd-notify --status="Waiting for data..." +done + + + See Also