{
    "mode": "man",
    "parameter": "systemd-notify",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/systemd-notify/1/json",
    "generated": "2026-06-14T13:01:54Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "systemd-notify - Notify service manager about start-up completion and other daemon status\nchanges\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "systemd-notify [OPTIONS...] [VARIABLE=VALUE...]",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "systemd-notify may be called by daemon scripts to notify the init system about status\nchanges. It can be used to send arbitrary information, encoded in an environment-block-like\nlist of strings. Most importantly, it can be used for start-up completion notification.\n\nThis is mostly just a wrapper around sdnotify() and makes this functionality available to\nshell scripts. For details see sdnotify(3).\n\nThe command line may carry a list of environment variables to send as part of the status\nupdate.\n\nNote that systemd will refuse reception of status updates from this command unless\nNotifyAccess= is set for the service unit this command is called from.\n\nNote that sdnotify() notifications may be attributed to units correctly only if either the\nsending process is still around at the time PID 1 processes the message, or if the sending\nprocess is explicitly runtime-tracked by the service manager. The latter is the case if the\nservice manager originally forked off the process, i.e. on all processes that match\nNotifyAccess=main or NotifyAccess=exec. Conversely, if an auxiliary process of the unit sends\nan sdnotify() message and immediately exits, the service manager might not be able to\nproperly attribute the message to the unit, and thus will ignore it, even if NotifyAccess=all\nis set for it. When --no-block is used, all synchronization for reception of notifications is\ndisabled, and hence the aforementioned race may occur if the invoking process is not the\nservice manager or spawned by the service manager.\n\nHence, systemd-notify will first attempt to invoke sdnotify() pretending to have the PID of\nthe invoking process. This will only succeed when invoked with sufficient privileges. On\nfailure, it will then fall back to invoking it under its own PID. This behaviour is useful in\norder that when the tool is invoked from a shell script the shell process — and not the\nsystemd-notify process — appears as sender of the message, which in turn is helpful if the\nshell process is the main process of a service, due to the limitations of NotifyAccess=all.\nUse the --pid= switch to tweak this behaviour.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are understood:\n",
            "subsections": [
                {
                    "name": "--ready",
                    "content": "Inform the init system about service start-up completion. This is equivalent to\nsystemd-notify READY=1. For details about the semantics of this option see sdnotify(3).\n",
                    "long": "--ready"
                },
                {
                    "name": "--pid=",
                    "content": "Inform the service manager about the main PID of the daemon. Takes a PID as argument. If\nthe argument is specified as \"auto\" or omitted, the PID of the process that invoked\nsystemd-notify is used, except if that's the service manager. If the argument is\nspecified as \"self\", the PID of the systemd-notify command itself is used, and if\n\"parent\" is specified the calling process' PID is used — even if it is the service\nmanager. This is equivalent to systemd-notify MAINPID=$PID. For details about the\nsemantics of this option see sdnotify(3).\n\n--uid=USER\nSet the user ID to send the notification from. Takes a UNIX user name or numeric UID.\nWhen specified the notification message will be sent with the specified UID as sender, in\nplace of the user the command was invoked as. This option requires sufficient privileges\nin order to be able manipulate the user identity of the process.\n"
                },
                {
                    "name": "--status=",
                    "content": "Send a free-form status string for the daemon to the init systemd. This option takes the\nstatus string as argument. This is equivalent to systemd-notify STATUS=.... For details\nabout the semantics of this option see sdnotify(3).\n"
                },
                {
                    "name": "--booted",
                    "content": "Returns 0 if the system was booted up with systemd, non-zero otherwise. If this option is\npassed, no message is sent. This option is hence unrelated to the other options. For\ndetails about the semantics of this option, see sdbooted(3). An alternate way to check\nfor this state is to call systemctl(1) with the is-system-running command. It will return\n\"offline\" if the system was not booted with systemd.\n",
                    "long": "--booted"
                },
                {
                    "name": "--no-block",
                    "content": "Do not synchronously wait for the requested operation to finish. Use of this option is\nonly recommended when systemd-notify is spawned by the service manager, or when the\ninvoking process is directly spawned by the service manager and has enough privileges to\nallow systemd-notify to send the notification on its behalf. Sending notifications with\nthis option set is prone to race conditions in all other cases.\n",
                    "long": "--no-block"
                },
                {
                    "name": "-h --help",
                    "content": "Print a short help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Print a short version string and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "On success, 0 is returned, a non-zero failure code otherwise.\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "",
            "subsections": [
                {
                    "name": "Example 1. Start-up Notification and Status Updates",
                    "content": "A simple shell daemon that sends start-up notifications after having set up its communication\nchannel. During runtime it sends further status updates to the init system:\n\n#!/bin/bash\n\nmkfifo /tmp/waldo\nsystemd-notify --ready --status=\"Waiting for data...\"\n\nwhile : ; do\nread a < /tmp/waldo\nsystemd-notify --status=\"Processing $a\"\n\n# Do something with $a ...\n\nsystemd-notify --status=\"Waiting for data...\"\ndone\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "systemd(1), systemctl(1), systemd.unit(5), sdnotify(3), sdbooted(3)\n\n\n\nsystemd 249                                                                        SYSTEMD-NOTIFY(1)",
            "subsections": []
        }
    },
    "summary": "systemd-notify - Notify service manager about start-up completion and other daemon status changes",
    "flags": [
        {
            "flag": "",
            "long": "--ready",
            "arg": null,
            "description": "Inform the init system about service start-up completion. This is equivalent to systemd-notify READY=1. For details about the semantics of this option see sdnotify(3)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Inform the service manager about the main PID of the daemon. Takes a PID as argument. If the argument is specified as \"auto\" or omitted, the PID of the process that invoked systemd-notify is used, except if that's the service manager. If the argument is specified as \"self\", the PID of the systemd-notify command itself is used, and if \"parent\" is specified the calling process' PID is used — even if it is the service manager. This is equivalent to systemd-notify MAINPID=$PID. For details about the semantics of this option see sdnotify(3). --uid=USER Set the user ID to send the notification from. Takes a UNIX user name or numeric UID. When specified the notification message will be sent with the specified UID as sender, in place of the user the command was invoked as. This option requires sufficient privileges in order to be able manipulate the user identity of the process."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 systemd-notify STATUS=.... For details about the semantics of this option see sdnotify(3)."
        },
        {
            "flag": "",
            "long": "--booted",
            "arg": null,
            "description": "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 sdbooted(3). An alternate way to check for this state is to call systemctl(1) with the is-system-running command. It will return \"offline\" if the system was not booted with systemd."
        },
        {
            "flag": "",
            "long": "--no-block",
            "arg": null,
            "description": "Do not synchronously wait for the requested operation to finish. Use of this option is only recommended when systemd-notify is spawned by the service manager, or when the invoking process is directly spawned by the service manager and has enough privileges to allow systemd-notify to send the notification on its behalf. Sending notifications with this option set is prone to race conditions in all other cases."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print a short help text and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print a short version string and exit."
        }
    ],
    "examples": [
        "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": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemctl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
        },
        {
            "name": "systemd.unit",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.unit/5/json"
        },
        {
            "name": "sdnotify",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/sdnotify/3/json"
        },
        {
            "name": "sdbooted",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/sdbooted/3/json"
        },
        {
            "name": "SYSTEMD-NOTIFY",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/SYSTEMD-NOTIFY/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Notify the service manager about start-up completion and other daemon status changes.",
        "examples": [
            {
                "description": "Notify systemd that the service has completed its initialization and is fully started. It should be invoked when the service is ready to accept incoming requests",
                "command": "systemd-notify --booted"
            },
            {
                "description": "Signal to systemd that the service is ready to handle incoming connections or perform its tasks",
                "command": "systemd-notify --ready"
            },
            {
                "description": "Provide a custom status message to systemd (this information is shown by `systemctl status`)",
                "command": "systemd-notify --status \"{{Add custom status message here...}}\""
            }
        ]
    }
}