daemon

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Psckage daemon has a few handy utility functions for server software.

Drop privileges.

Index

Constants

This section is empty.

Variables

View Source
var ErrorNotRoot = errors.New("not running as root, so can't drop privileges to specified user")

ErrorNotRoot is returned when the user doesn't have root privileges.

Functions

func BreakChannel

func BreakChannel() chan bool

BreakChannel generates a goroutine which waits for ctrl-C to be pressed, and returns a channel to wait on. Using it can be as simple as:

<-daemon.BreakChannel()

func DegradeToUser

func DegradeToUser(uname string) error

DegradeToUser drops down to a specific user and its primary group if run by root.

Types

This section is empty.

Jump to

Keyboard shortcuts

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