sdnotify

package
v0.0.0-...-09b25d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sdnotify tells systemd how a service is doing, over the socket systemd names in NOTIFY_SOCKET: that it is ready, that it is still alive (the watchdog) and that it is stopping. Outside systemd, or in a unit without Type=notify, every call does nothing and reports no error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interval

func Interval() time.Duration

Interval is how often Watchdog should be called: half of what the unit's WatchdogSec= allows, or zero when systemd expects no keep-alives.

func Keep

func Keep(ctx context.Context, alive func() bool)

Keep sends keep-alives until ctx ends, each one only while alive says the service still works, so a wedged service is restarted rather than kept. It returns at once when no watchdog is set.

func Ready

func Ready() error

Ready says the service is up and serving.

func Status

func Status(s string) error

Status sets the one-line status that systemctl shows.

func Stopping

func Stopping() error

Stopping says the service has begun to shut down.

func Watchdog

func Watchdog() error

Watchdog sends one keep-alive. With WatchdogSec= in the unit, systemd restarts a service that stays quiet for that long.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL