summaryrefslogtreecommitdiffstats
path: root/man/notify-selfcontained-example.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* man: Ensure notify example includes <string.h>A. Wilcox2024-08-211-0/+1
| | | | | This ensures that memcpy and strerror are defined. This is especially important with GCC 14 as implicit function declarations are now an error.
* man/notify-selfcontained-example: check argument firstZbigniew Jędrzejewski-Szmek2024-04-041-4/+6
| | | | | | | | This is just good style. In this particular case, if the argument is incorrect and the function is not tested with $NOTIFY_SOCKET set, the user could not get the proper error until running for real. Also, remove mention of systemd. The protocol is fully generic on purpose.
* man/examples: set _GNU_SOURCE in source, rather than by compile optionYu Watanabe2024-04-031-0/+1
| | | | Addresses https://github.com/systemd/systemd/pull/32057#issuecomment-2034408569.
* notify-example: also send STOPPING=1 at exitLennart Poettering2024-04-031-0/+12
| | | | | | | | | | | | I think the example should reflect the full set of lifecycle messages, including STOPPING=1, which tells the service manager that the service is already terminating. This is useful for reporting this information back to the user and to suppress repeated shutdown requests. It's not as important as the READY=1 and RELOADING=1 messages, since we actively wait for those from the service message if the right Type= is set. But it's still very valuable information, easy to do, and completes the state engine.
* man: add self-contained example of notify protocolLuca Boccassi2024-04-021-0/+173
We are saying in public that the protocl is stable and can be easily reimplemented, so provide an example doing so in the documentation, license as MIT-0 so that it can be copied and pasted at will.