package osutil

import "go.etcd.io/etcd/pkg/v3/osutil"

Package osutil implements operating system-related utility functions.

Index

Functions

func Exit

func Exit(code int)

Exit relays to os.Exit if no interrupt handlers are running, blocks otherwise.

func HandleInterrupts

func HandleInterrupts(lg *zap.Logger)

HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.

func RegisterInterruptHandler

func RegisterInterruptHandler(h InterruptHandler)

RegisterInterruptHandler registers a new InterruptHandler. Handlers registered after interrupt handing was initiated will not be executed.

func Unsetenv

func Unsetenv(key string) error

Types

type InterruptHandler

type InterruptHandler func()

InterruptHandler is a function that is called on receiving a SIGTERM or SIGINT signal.

Source Files

interrupt_unix.go osutil.go signal_linux.go

Version
v3.5.18 (latest)
Published
Jan 24, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
6 days ago

Tools for package owners.