pub struct Notify { /* private fields */ }
Available on Linux only.
Expand description

Systemd notifier.

This is only used by systemd if the service definition file has Type=notify set, see systemd.service(5). Read sd_notify(3) for more information about notifying the service manager about start-up completion and other service status changes.

Implementations

Create a systemd notifier using the environment variables.

This method uses the following environment variables to configure itself:

  • NOTIFY_SOCKET: the socket to connect to.
  • WATCHDOG_PID and WATCHDOG_USEC: enables the watchdog, see systemd.service(5).

Returns None if the environment NOTIFY_SOCKET variable is not set.

Create a systemd notifier connected to path.

Set the watchdog timeout of Notify.

Note that this doesn’t change the timeout for the service manager.

Returns the watchdog timeout, if any.

Inform the service manager of a change in the application state.

status is a string to describe the service state. This is free-form and can be used for various purposes: general state feedback, fsck-like programs could pass completion percentages and failing programs could pass a human-readable error message. Note that it must be limited to a single line.

Inform the service manager of a change in the application status.

status is a string to describe the service state. This is free-form and can be used for various purposes: general state feedback, fsck-like programs could pass completion percentages and failing programs could pass a human-readable error message. Note that it must be limited to a single line.

If you also need to change the state of the application you can use Notify::change_state.

Inform the service manager to update the watchdog timestamp.

Send a keep-alive ping that services need to issue in regular intervals if WatchdogSec= is enabled for it.

Inform the service manager that the service detected an internal error that should be handled by the configured watchdog options.

This will trigger the same behaviour as if WatchdogSec= is enabled and the service did not call ping_watchdog in time.

Note that WatchdogSec= does not need to be enabled for this to trigger the watchdog action. See systemd.service(5) for information about the watchdog behavior.

Trait Implementations

Error type used in bind_to. Read more
Bind a type to the Actor that owns the ctx. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.