summaryrefslogtreecommitdiff
path: root/man/sd_notify.xml
Commit message (Collapse)AuthorAgeFilesLines
* sd-daemon: add sd_pid_notify_barrier() call and use it in systemd-notifyLennart Poettering2023-05-031-2/+12
| | | | | Previously we'd honour --pid= from the main notification we send, but not from the barrier. This is confusing at best. Let's fix that.
* sd-daemon: add sd_pid_notifyf_with_fds()Lennart Poettering2023-04-251-6/+22
| | | | | | | | | | | | I guess it was only a question of time until we need to add the final frontier of notification functions: one that combines the features of all the others: 1. specifiying a source PID 2. taking a list of fds to send along 3. accepting a format string for the status string Hence, let's add it.
* notify: Add EXIT_STATUS fieldDaan De Meyer2023-04-121-0/+7
| | | | | Whenever one of our tools or daemons exits, let's send the exit status via sd-notify in the EXIT_STATUS field.
* man: rebreak all of sd_notify(3)Lennart Poettering2023-04-121-163/+135
| | | | | No change of contents, just some rebreaking of the full file to match our current line break settings.
* service: tell service processes that the fdstore is available via an env varLennart Poettering2023-04-121-29/+28
|
* core: support overriding NOTIFYACCESS= through sd-notify during runtimeMike Yuan2023-03-221-0/+10
| | | | Closes #25963
* man: add mention that libsystemd uses getenv()Zbigniew Jędrzejewski-Szmek2023-03-081-0/+1
| | | | | | | | | | | | | | | | See #26688: getenv() is not thread-safe, and could a possible source of problems when a multi-threaded program calls setenv()/putenv()/unsetenv() in parallel. It is not possible to avoid getenv() calls in general, since $PATH, $LANG, $SHELL, $USER, $HOME, $TZ may need to be accessed at any time. Add a warning to our docs so that people are aware of the issue. Closes #26688. (Real fixes will need to be in glibc and gnome-shell or other programs.) The text is added to threads-aware.xml to be included in various places. By including it in libsystemd-pkgconfig.xml, it is automatically added to all sd-* pages. The text is also included explicitly in pages for a few other functions which are call getenv().
* man/sd_notify: fix indentation in sample programsZbigniew Jędrzejewski-Szmek2023-01-221-11/+14
| | | | | | Whether we use a newline at the beginning of <programlisting> or not doesn't seem to have any effect. So let's use the newline in multi-line examples; it is easier to get the indentation right this way.
* man: document Type=notify-reloadLennart Poettering2023-01-101-12/+24
|
* sd_notify: support AF_VSOCKLuca Boccassi2023-01-051-7/+20
| | | | | | | | Allow sending notifications via AF_VSOCK, so that VMs can communicate to the hypervisor/VMM that they are finished booting. Note that if the hypervisor does not support SOCK_DGRAM over AF_VSOCK (ie: qemu at the time of writing), SOCK_SEQPACKET will be used instead.
* man: recommend strerror_r() over strerror()Zbigniew Jędrzejewski-Szmek2022-10-111-2/+2
| | | | | | | | | | Let's nudge people towards the use of an anonymous buffer like we do internally. "errno" → "errnum", to match the man page for strerror, and also to avoid confusion with the global variable. In general, I think that errno is a terrible interface and we shouldn't encourage people to use it. Those functions use errno-style error numbers, which are a different thing.
* man: fix formatting of "BARRIER=1"Zbigniew Jędrzejewski-Szmek2022-07-141-8/+9
| | | | | Whitespace inside of the <varname> field was propagated to the displayed form, causing strange indentation.
* docs: Clarify that the fd store is discarded when a service is stoppedDaan De Meyer2021-12-081-2/+3
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* man: use trailing slash on directories in more placesZbigniew Jędrzejewski-Szmek2020-10-051-1/+1
|
* man: fix few spelling errorsFrantisek Sumsal2020-05-031-1/+1
| | | | Reported by Fossies.org.
* Introduce sd_notify_barrierKumar Kartikeya Dwivedi2020-05-011-0/+49
| | | | | | | | | | | | | | | This adds the sd_notify_barrier function, to allow users to synchronize against the reception of sd_notify(3) status messages. It acts as a synchronization point, and a successful return gurantees that all previous messages have been consumed by the manager. This can be used to eliminate race conditions where the sending process exits too early for systemd to associate its PID to a cgroup and attribute the status message to a unit correctly. systemd-notify now uses this function for proper notification delivery and be useful for NotifyAccess=all units again in user mode, or in cases where it doesn't have a control process as parent. Fixes: #2739
* core: Add optional FDPOLL=0 argument to fdstoreKenny Levinsen2020-04-301-2/+12
| | | | | | | | A service can specify FDSTORE=1 FDPOLL=0 to request that PID1 does not poll the fd to remove them on error. If set, fds will only be removed on FDSTOREREMOVE=1 or when the service is done. Fixes: #12086
* man: Fix typo in sd_notify man pagePhilip Withnall2019-06-121-1/+1
| | | | Signed-off-by: Philip Withnall <withnall@endlessm.com>
* core: immediately trigger watchdog action on WATCHDOG=triggerJan Klötzke2019-04-241-0/+12
| | | | | | | | A service might be able to detect errors by itself that may require the system to take the same action as if the service locked up. Add a WATCHDOG=trigger state change notification to sd_notify() to let the service manager know about the self-detected misery and instantly trigger the configured watchdog behaviour.
* man: use same header for all filesZbigniew Jędrzejewski-Szmek2019-03-141-1/+1
| | | | | | | The "include" files had type "book" for some raeason. I don't think this is meaningful. Let's just use the same everywhere. $ perl -i -0pe 's^..DOCTYPE (book|refentry) PUBLIC "-//OASIS//DTD DocBook XML V4.[25]//EN"\s+"http^<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"\n "http^gms' man/*.xml
* man: standarize on one-line license headerZbigniew Jędrzejewski-Szmek2019-03-141-4/+1
| | | | | | No need to waste space, and uniformity is good. $ perl -i -0pe 's|\n+<!--\s*SPDX-License-Identifier: LGPL-2.1..\s*-->|\n<!-- SPDX-License-Identifier: LGPL-2.1+ -->|gms' man/*.xml
* man: drop mode line in file headersZbigniew Jędrzejewski-Szmek2018-07-031-1/+1
| | | | | This is already included in .dir-locals, so we don't need it in the files themselves.
* man: drop unused <authorgroup> tags from man sourcesZbigniew Jędrzejewski-Szmek2018-06-141-9/+0
| | | | | | | | | | | | Docbook styles required those to be present, even though the templates that we use did not show those names anywhere. But something changed semi-recently (I would suspect docbook templates, but there was only a minor version bump in recent years, and the changelog does not suggest anything related), and builds now work without those entries. Let's drop this dead weight. Tested with F26-F29, debian unstable. $ perl -i -0pe 's/\s*<authorgroup>.*<.authorgroup>//gms' man/*xml
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in ↵Daniel Black2017-12-141-0/+12
| | | | | | | | | | | | | | | | | | | | startup/runtime/shutdown (#7214) With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/ runtime/shutdown timeouts. A service that hasn't timed out, i.e, start time < TimeStartSec, runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec). EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as WATCHDOG=1) within the time interval specified to continue to reprevent the timeout from occuring. Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater than the remaining time on the watchdog counter. Fixes #5868.
* core: add a new sd_notify() message for removing fds from the FD store againLennart Poettering2017-11-271-15/+16
| | | | | | | | | Currenly the only way to remove fds from the fdstore is to fully stop the service, or to somehow trigger POLLERR/POLLHUP on the fd, in which case systemd will remove the fd automatically. Let's add another way: a new message that can be sent to remove fds explicitly, given their name.
* man: slightly improve the sd_notify() documentation regarding READY=1Lennart Poettering2017-11-271-6/+4
| | | | | READY=1 may be used to signal when a service finished startup, but also when it finished reloading. Say so.
* service: reorder sd_notify() handling a bitLennart Poettering2017-11-271-9/+8
| | | | | Let's keep handling of WATCHDOG= and WATCHDOG_USEC= together. No functional changes.
* Add SPDX license identifiers to man pagesZbigniew Jędrzejewski-Szmek2017-11-191-0/+2
|
* core: propagate reload from RELOADING=1 notification (#6550)Jouke Witteveen2017-08-071-1/+2
|
* core: permit FDSTORE=1 messages with non-pollable fdsLennart Poettering2017-06-261-26/+26
| | | | | | | | | This also alters the documentation to recommend memfds rather than /run for serializing state across reboots. That's because /run doesn't actually have the same lifecycle as the fd store, as it is cleared out on restarts. Fixes: #5606
* man: document that sd_notify() is racy in some casesLennart Poettering2017-02-061-0/+9
|
* man: use unicode ellipsis in more placesZbigniew Jędrzejewski-Szmek2016-12-111-10/+10
| | | | | | | | | | | | | | As requested in https://github.com/systemd/systemd/pull/4864#pullrequestreview-12372557. docbook will substitute triple dots for the ellipsis in man output, so this has no effect on the troff output, only on HTML, making it infinitesimally nicer. In some places we show output from programs, which use dots, and those places should not be changed. In some tables, the alignment would change if dots were changed to the ellipsis which is only one character. Since docbook replaces the ellipsis automatically, we should leave those be. This patch changes all other places.
* man: add a note that FDSTORE=1 requires epoll-compatible fdsZbigniew Jędrzejewski-Szmek2016-10-281-22/+19
| | | | Let's say that this was not obvious from our man page.
* watchdog: Support changing watchdog_usec during runtime (#3492)Minkyung2016-06-221-0/+9
| | | | | | | | | | | | | | Add sd_notify() parameter to change watchdog_usec during runtime. Application can change watchdog_usec value by sd_notify like this. Example. sd_notify(0, "WATCHDOG_USEC=20000000"). To reset watchdog_usec as configured value in service file, restart service. Notice. sd_event is not currently supported. If application uses sd_event_set_watchdog, or sd_watchdog_enabled, do not use "WATCHDOG_USEC" option through sd_notify.
* man: fix typosJakub Wilk2015-12-261-1/+1
|
* doc: correct orthography, word forms and missing/extraneous wordsJan Engelhardt2015-11-061-1/+1
|
* doc: correct punctuation and improve typography in documentationJan Engelhardt2015-11-061-8/+8
|
* man: Drop "internally," which is misleadingDavid Strauss2015-11-021-1/+1
| | | The existing text misleads readers into thinking how the notify socket protocol is "internals" and that they can only use the functions. However, the socket is part of the Interface Stability Promise. So, we should drop "internally" from the description so the man page both indicates both how the functions work and how one would talk to the socket directly.
* core: add support for naming file descriptors passed using socket activationLennart Poettering2015-10-061-4/+27
| | | | | | | | | | | | | | | | | | | | | | | This adds support for naming file descriptors passed using socket activation. The names are passed in a new $LISTEN_FDNAMES= environment variable, that matches the existign $LISTEN_FDS= one and contains a colon-separated list of names. This also adds support for naming fds submitted to the per-service fd store using FDNAME= in the sd_notify() message. This also adds a new FileDescriptorName= setting for socket unit files to set the name for fds created by socket units. This also adds a new call sd_listen_fds_with_names(), that is similar to sd_listen_fds(), but also returns the names of the fds. systemd-activate gained the new --fdname= switch to specify a name for testing socket activation. This is based on #1247 by Maciej Wereski. Fixes #1247.
* man: remove repeated word "the" and polishJay Strict2015-06-291-1/+1
|
* man: revert dynamic paths for split-usr setupsTom Gundersen2015-06-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | This did not really work out as we had hoped. Trying to do this upstream introduced several problems that probably makes it better suited as a downstream patch after all. At any rate, it is not releaseable in the current state, so we at least need to revert this before the release. * by adjusting the path to binaries, but not do the same thing to the search path we end up with inconsistent man-pages. Adjusting the search path too would be quite messy, and it is not at all obvious that this is worth the effort, but at any rate it would have to be done before we could ship this. * this means that distributed man-pages does not make sense as they depend on config options, and for better or worse we are still distributing man pages, so that is something that definitely needs sorting out before we could ship with this patch. * we have long held that split-usr is only minimally supported in order to boot, and something we hope will eventually go away. So before we start adding even more magic/effort in order to make this work nicely, we should probably question if it makes sense at all.
* man: generate configured paths in manpagesFilipe Brandenburger2015-05-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, use /lib/systemd instead of /usr/lib/systemd in distributions like Debian which still have not adopted a /usr merge setup. Use XML entities from man/custom-entities.ent to replace configured paths while doing XSLT processing of the original XML files. There was precedent of some files (such as systemd.generator.xml) which were already using this approach. This addresses most of the (manual) fixes from this patch: http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/patches/Fix-paths-in-man-pages.patch?h=experimental-220 The idea of using generic XML entities was presented here: http://lists.freedesktop.org/archives/systemd-devel/2015-May/032240.html This patch solves almost all the issues, with the exception of: - Path to /bin/mount and /bin/umount. - Generic statements about preference of /lib over /etc. These will be handled separately by follow up patches. Tested: - With default configure settings, ran "make install" to two separate directories and compared the output to confirm they matched exactly. - Used a set of configure flags including $CONFFLAGS from Debian: http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/rules Installed the tree and confirmed the paths use /lib/systemd instead of /usr/lib/systemd and that no other unexpected differences exist. - Confirmed that `make distcheck` still passes.
* Reindent man pages to 2chZbigniew Jędrzejewski-Szmek2015-02-031-403/+351
|
* treewide: fix multiple typosTorstein Husebø2015-01-261-1/+1
|
* core: add new logic for services to store file descriptors in PID 1Lennart Poettering2015-01-061-6/+116
| | | | | | | | | | | | | | With this change it is possible to send file descriptors to PID 1, via sd_pid_notify_with_fds() which PID 1 will store individually for each service, and pass via the usual fd passing logic on next invocation. This is useful for enable daemon reload schemes where daemons serialize their state to /run, push their fds into PID 1 and terminate, restoring their state on next start from the data in /run and passed in from PID 1. The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on them, and the service they belong to are either not dead or failed, or have a job queued.
* sd-daemon,man: ignore missing $WATCHDOG_PIDZbigniew Jędrzejewski-Szmek2014-10-231-10/+5
| | | | | | | | | | | | | | | | Systemd 209 started setting $WATCHDOG_PID, and sd-daemon watch was modified to check for this variable. This means that sd_watchdog_enabled() stopped working with previous versions of systemd. But sd-event is a public library and API and we must keep it working even when a program compiled with a newer version of the libary is used on a system running an older version of the manager. getenv() and unsetenv() are fairly expensive calls, so optimize sd_watchdog_enabled() by not calling them when unnecessary. man: centralize the description of $WATCHDOG_PID and $WATCHDOG_USEC in the sd_watchdog_enabled manpage. It is better not to repeat the same stuff in two places.