Help us shape the future of Go! Take the 2026 Go Developer Survey

systemd

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package systemd integrates with a systemd service manager when one is present: sd_notify readiness/status/stopping messages (Type=notify units) and detection of journald as the log sink. Everything is a no-op outside systemd, so the same binary runs unchanged in containers and on OpenWrt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Notify

func Notify(state string) bool

Notify sends one sd_notify(3) state string. It returns true when the message was delivered, false when there is no notify socket or sending failed (logged at debug level; never fatal).

func NotifyAvailable

func NotifyAvailable() bool

NotifyAvailable reports whether systemd handed us a notify socket ($NOTIFY_SOCKET), i.e. the unit is Type=notify (or NotifyAccess= allows it).

func Ready

func Ready() bool

Ready tells systemd the service finished starting (READY=1).

func Status

func Status(text string) bool

Status sets the free-form status line shown by `systemctl status`.

func StderrIsJournal

func StderrIsJournal() bool

StderrIsJournal reports whether stderr is connected to the systemd journal ($JOURNAL_STREAM matches the stderr device/inode), in which case journald records its own timestamps and ours would be redundant.

func Stopping

func Stopping() bool

Stopping tells systemd the service began shutting down (STOPPING=1).

Types

This section is empty.

Jump to

Keyboard shortcuts

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