daemon

package
v0.0.0-...-d3ccc4f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Code forked from Docker project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SdNotify

func SdNotify(unsetEnvironment bool, state string) (sent bool, err error)

SdNotify sends a message to the init daemon. It is common to ignore the error. If `unsetEnvironment` is true, the environment variable `NOTIFY_SOCKET` will be unconditionally unset.

It returns one of the following: (false, nil) - notification not supported (i.e. NOTIFY_SOCKET is unset) (false, err) - notification supported, but failure happened (e.g. error connecting to NOTIFY_SOCKET or while sending data) (true, nil) - notification supported, data has been sent

func SdWatchdogEnabled

func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error)

SdWatchdogEnabled return watchdog information for a service. Process should send daemon.SdNotify("WATCHDOG=1") every time / 2. If `unsetEnvironment` is true, the environment variables `WATCHDOG_USEC` and `WATCHDOG_PID` will be unconditionally unset.

It returns one of the following: (0, nil) - watchdog isn't enabled or we aren't the watched PID. (0, err) - an error happened (e.g. error converting time). (time, nil) - watchdog is enabled and we can send ping.

time is delay before inactive service will be killed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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